如何通过CompilerType支持#ifdef来? GCC或VC ++ [英] How to #ifdef by CompilerType ? GCC or VC++

查看:216
本文介绍了如何通过CompilerType支持#ifdef来? GCC或VC ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的#ifdef的Win32 安全调用都 sprintf_s 但现在我想使用MinGW建设项目,它的现在只是错了。我需要使用 #IFDEF VC ++ 或以某种方式这样。这可能吗?

I used #ifdef Win32 for safe calls alike sprintf_s but now I want to build project with MinGW and it's just wrong now. I need to use #ifdef VC++ or somehow like that. Is it possible?

推荐答案

请参阅Micr​​osoft特定的predefined宏表http://msdn.microsoft.com/en-us/库/ b0084kay%28VS.80%29.aspx>的Visual C predefined宏

See the "Microsoft-Specific Predefined Macros" table of Visual C predefined macros

您可以检查 _MSC_VER

这篇关于如何通过CompilerType支持#ifdef来? GCC或VC ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆