XIEITE_COMPILER_TYPE_ /*???*/
, XIEITE_COMPILER_MAJOR_ /*???*/
, XIEITE_COMPILER_MINOR_ /*???*/
, XIEITE_COMPILER_PATCH_ /*???*/
, XIEITE_COMPILER_EQ ()
, XIEITE_COMPILER_LEAST ()
, XIEITE_COMPILER_MOST ()
Defined in header <xieite/pp/compiler.hpp>
Macros for identifying the current compiler and its version (major, minor, patch).
The macros are not mutually exclusive because I have no way to check which compilers are (e.g. Clang defines GCC and MSVC macros too).
Definitions
#typeUse with#define XIEITE_COMPILER_TYPE_ /*???*/ /* boolean integer literal */ #define XIEITE_COMPILER_MAJOR_ /*???*/ /* integer literal */ #define XIEITE_COMPILER_MINOR_ /*???*/ /* integer literal */ #define XIEITE_COMPILER_PATCH_ /*???*/ /* integer literal */
ACC
, ACK
, ALTIUM_C_TO_HARDWARE
, ALTIUM_MICROBLAZE_C
, AOCC
, ARMCC
, AZTEC_C
, BORLAND
, CC65
, CIRCLE
, CLANG
, COMEAU
, COMPAQ_C
, COMPAQ_CPP
, COMPCERT
, CONVEX_C
, COVERITY_STATIC_ANALYZER
, CRAY
, DIGITAL_MARS
, DICE_C
, DIGNUS_SYSTEMS_CPP
, DJGPP
, EDG
, EKOPATH
, ELLCC
, EMSCRIPTEN
, FUJITSU_CPP
, GCC
, GCC_XML
, GREEN_HILLS
, HEXAGON
, HIPCC
, HP_ACC
, HP_ANSI_C
, IAR
, ICC
, ICX
, IMAGECRAFT_C
, KCC
, KEIL_C166
, KEIL_C51
, KEIL_CARM
, KICKC
, LATTICE_C
, LCC
, LIGHTSPEED_C
, LLVM
, METAWARE_HIGH
, METROWERKS_CODEWARRIOR
, MICROTEC
, MICROWAY_NDP_C
, MINGW32
, MINGW_W64
, MIPSPRO
, MIRACLE_C
, MPW
, MSVC
, NORCROFT_C
, NVIDIA_HPC
, NVCC
, NWCC
, OPEN64
, OPENACC
, OPENSERVER
, PACIFIC_C
, PALM
, PELLES_C
, PGI
, PRO_C
, RENESAS
, SDCC
, SNC
, STRATUS_VOS_C
, SUNPRO_C
, SUNPRO_CPP
, SYMANTEC_CPP
, TCC
, TENDRA
, TI_CGT
, TI_CL430
, TURBO
, ULTIMATE
, USL_C
, VBCC
, WATCOM
, WIND_RIVER_DIAB
, XC8
, XC16
, XC32
, XC_DSC
, XL
, ZORTECH_CPP
, or Z88DK
. See example.#eq
Allows two optional arguments for the minor and patch version numbers. Expands to an expression checking whether a compiler is in use and its version is equal to some value.#define XIEITE_COMPILER_EQ (type ,major ,... /* minor, patch */ )/* boolean expression */
#least
Expands to an expression checking whether a compiler is in use and its version is equal to or greater than some value.#define XIEITE_COMPILER_LEAST (type ,major ,... /* minor, patch */ )/* boolean expression */
#most
Expands to an expression checking whether a compiler is in use and its version is equal to or less than some value.#define XIEITE_COMPILER_MOST (type ,major ,... /* minor, patch */ )/* boolean expression */
Example
Possible output:int main () {std ::"Is current compiler GCC? ,{}\n "XIEITE_COMPILER_TYPE_GCC ); }
[View in Compiler Explorer]Is current compiler GCC? 1