Skip to content

Instantly share code, notes, and snippets.

@xboard
Last active July 12, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xboard/beceb32b670c76efaa20564e4e2a2048 to your computer and use it in GitHub Desktop.
Save xboard/beceb32b670c76efaa20564e4e2a2048 to your computer and use it in GitHub Desktop.
Macros for checking C/C++ compiler in use.
#ifdef __clang__
/*code specific to clang compiler*/
#elif __GNUC__
/*code for GNU C compiler */
#elif _MSC_VER
/*usually has the version number in _MSC_VER*/
/*code specific to MSVC compiler*/
#elif __BORLANDC__
/*code specific to borland compilers*/
#elif __MINGW32__
/*code specific to mingw compilers*/
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment