Detect Clang compiler version with its id

Decode decimal digits from

  __clang_major__
  __clang_minor__
  __clang_patchlevel__

to compute version number components.  See documentation at:

  http://clang.llvm.org/docs/LanguageExtensions.html#builtinmacros
  http://predef.sourceforge.net/precomp.html
This commit is contained in:
Brad King 2011-12-06 15:14:47 -05:00
parent b8cfa656ce
commit 5899b988d5
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,9 @@
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"

View File

@ -19,6 +19,9 @@
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"