Search code examples
cconditional-compilation

How to #ifdef by CompilerType ? GCC or 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?


Solution

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

    You could check for _MSC_VER.