XTE _ COMPILER
Defined in header <xte/preproc/compiler.hpp> Macros for detecting the current compiler. Definitions are compiler-dependent and not mutually exclusive.
Replace
NAME with one of: Definitions
#compilerDetects the presence of an compiler.#define XTE_COMPILER_ NAME /* boolean integer literal */
#major
Detects the major version of a compiler.#define XTE_COMPILER_ NAME _MAJOR /* integer literal */
#minor
Detects the minor version of a compiler.#define XTE_COMPILER_ NAME _MINOR /* integer literal */
#patch
Detects the patch version of a compiler.#define XTE_COMPILER_ NAME _PATCH /* integer literal */
#version
#define XTE_COMPILER (NAME ,OP ,MAJOR ,/* MINOR, PATCH */ ... )/* boolean expression */
OP must be <, <=, >, >=, ==, or !=. Allows up to two additional arguments for the minor and patch versions. Expands to an expression comparing a compiler's version to the provided arguments.Example
Possible preprocessor output:#if XTE_COMPILER (GCC , >=,16 ,1 ) yup#else nop#endif
[View in Compiler Explorer]yup