XTE_STDLIB

Defined in header <xte/preproc/lang.hpp>

Macros for detecting the standard library. Definitions are compiler-dependent and might not be mutually exclusive.

Replace NAME with one of: BIONIC_C, CLOUDABI_C, COMO_CPP, DINKUMWARE_CPP, GNU_C, GNU_CPP, IBM_VA_CPP, KLIBC, LLVM_C, LLVM_CPP, METROWERKS_CPP, MFC_CPP, MODENA_CPP, MSVC_C, MSVC_CPP, PDP_C, ROGUEWAVE_CPP, SGI_CPP, UCLIBC, VMS_C, Z_C, Z88DK_C.


Definitions

#stdlib
#define XTE_STDLIB_NAME /* boolean integer literal */
Detects the presence of an standard library.

#major
#define XTE_STDLIB_NAME_MAJOR /* integer literal */
Detects the major version of a standard library.

#minor
#define XTE_STDLIB_NAME_MINOR /* integer literal */
Detects the minor version of a standard library.

#patch
#define XTE_STDLIB_NAME_PATCH /* integer literal */
Detects the patch version of a standard library.

#version
#define XTE_STDLIB(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 standard library's version to the provided arguments.



Example

#if XTE_STDLIB(GNU_CPP, >=, 17)
	yup
#else
	nop
#endif
Possible preprocessor output:
yup
[View in Compiler Explorer]