Skip to content

Instantly share code, notes, and snippets.

@2bbb
Forked from yohhoy/ver.cpp
Created April 18, 2019 16:05
Show Gist options
  • Save 2bbb/db4c9eeedc7fa04f3ce7cd3dc28d9eaa to your computer and use it in GitHub Desktop.
Save 2bbb/db4c9eeedc7fa04f3ce7cd3dc28d9eaa to your computer and use it in GitHub Desktop.
compiler version snippet
#if defined(__clang__)
#pragma message "Clang " __VERSION__
#elif defined(__GNUC__)
#pragma message "GCC " __VERSION__
#elif defined(_MSC_VER)
// https://qiita.com/yumetodo/items/8c112fca0a8e6b47072d
#define STR(s) #s
#define DUMP(s) #s "=" STR(s)
#pragma message ("MSVC " DUMP(_MSC_VER) " " DUMP(_MSC_FULL_VER))
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment