Reputation: 7403
I would like to conditionally compile certain parts of code based on Compiler Type is there any macro for that?
Like this:
#if defined (COMPILER_TYPE e.g. GCC)
// Compile this
#elif defined (COMPILER_TYPE e.g. Visual Studio C Compiler)
// Else this
#endif
Thank you
Upvotes: 0
Views: 313
Reputation:
You can check if these macros are defined, __GNUC__
for GCC and _MSC_VER
for MSVC.
Upvotes: 2