Detect IBM XL compiler version with its id
Decode decimal digits from __IBMC__ and __IBMCPP__ to compute version number components. See documentation at: http://predef.sourceforge.net/precomp.html http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/topic/com.ibm.xlc111.aix.doc/compiler_ref/xlmacros.html http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/topic/com.ibm.xlcpp111.aix.doc/compiler_ref/xlmacros.html
This commit is contained in:
parent
4080d5510e
commit
6dae6660fc
|
@ -38,11 +38,16 @@
|
||||||
#elif defined(__IBMC__)
|
#elif defined(__IBMC__)
|
||||||
# if defined(__COMPILER_VER__)
|
# if defined(__COMPILER_VER__)
|
||||||
# define COMPILER_ID "zOS"
|
# define COMPILER_ID "zOS"
|
||||||
# elif __IBMC__ >= 800
|
# else
|
||||||
|
# if __IBMC__ >= 800
|
||||||
# define COMPILER_ID "XL"
|
# define COMPILER_ID "XL"
|
||||||
# else
|
# else
|
||||||
# define COMPILER_ID "VisualAge"
|
# define COMPILER_ID "VisualAge"
|
||||||
# endif
|
# endif
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
#elif defined(__PGI)
|
#elif defined(__PGI)
|
||||||
# define COMPILER_ID "PGI"
|
# define COMPILER_ID "PGI"
|
||||||
|
|
|
@ -40,11 +40,16 @@
|
||||||
#elif defined(__IBMCPP__)
|
#elif defined(__IBMCPP__)
|
||||||
# if defined(__COMPILER_VER__)
|
# if defined(__COMPILER_VER__)
|
||||||
# define COMPILER_ID "zOS"
|
# define COMPILER_ID "zOS"
|
||||||
# elif __IBMCPP__ >= 800
|
# else
|
||||||
|
# if __IBMCPP__ >= 800
|
||||||
# define COMPILER_ID "XL"
|
# define COMPILER_ID "XL"
|
||||||
# else
|
# else
|
||||||
# define COMPILER_ID "VisualAge"
|
# define COMPILER_ID "VisualAge"
|
||||||
# endif
|
# endif
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
#elif defined(__PGI)
|
#elif defined(__PGI)
|
||||||
# define COMPILER_ID "PGI"
|
# define COMPILER_ID "PGI"
|
||||||
|
|
Loading…
Reference in New Issue