Detect HP compiler version with its id

Decode decimal digits from __HP_cc and __HP_aCC to compute version
number components.  See documentation at:

  http://predef.sourceforge.net/precomp.html
  http://g4u0420c.houston.hp.com/en/14487/preprocess.htm
This commit is contained in:
Brad King 2012-01-10 13:07:04 -05:00
parent 3dd9fa9d6a
commit d7c6f410f9
2 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,9 @@
#elif defined(__HP_cc) #elif defined(__HP_cc)
# define COMPILER_ID "HP" # define COMPILER_ID "HP"
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
#elif defined(__DECC) #elif defined(__DECC)
# define COMPILER_ID "Compaq" # define COMPILER_ID "Compaq"

View File

@ -47,6 +47,9 @@
#elif defined(__HP_aCC) #elif defined(__HP_aCC)
# define COMPILER_ID "HP" # define COMPILER_ID "HP"
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX) #elif defined(__DECCXX)
# define COMPILER_ID "Compaq" # define COMPILER_ID "Compaq"