XIEITE_PLTF_TYPE_/* ??? */, XIEITE_PLTF_MAJOR_/* ??? */, XIEITE_PLTF_MINOR_/* ??? */, XIEITE_PLTF_PATCH_/* ??? */, XIEITE_PLTF_EQ(), XIEITE_PLTF_LEAST(), XIEITE_PLTF_MOST()

Defined in header <xieite/pp/pltf.hpp>

Macros for identifying the current platform or operating system and its version (major, minor, patch).
The macros are not mutually exclusive due to some being related to others (e.g. an Android platform is also a Linux platform).


Definitions

#type
#define XIEITE_PLTF_TYPE_/* ??? */ /* integer literal (0 or 1) */
#define XIEITE_PLTF_MAJOR_/* ??? */ /* integer literal */
#define XIEITE_PLTF_MINOR_/* ??? */ /* integer literal */
#define XIEITE_PLTF_PATCH_/* ??? */ /* integer literal */
Use with AEGIS, AIX, AKAROS, AMIGAOS, ANDROID, ASMJS, BEOS, BLUE_GENE, BSD, BSD_BSDI, BSD_DRAGONFLY, BSD_FREE, BSD_NET, BSD_OPEN, CLOUDABI, CONVEXOS, CYGWIN, DC_OSX, DG_UX, DOMAIN_OS, DRAGONFLY, DYNIX, ECOS, EMX, FREEBSD, FUCHSIA, GNU_HURD, GNU_KFREEBSD, GNU_LINUX, HAIKU, HI_UX_MPP, HP_UX, INTEGRITY, INTERIX, IOS_SIMULATOR, IRIX, KALLISTI, LINUX, LYNXOS, MACINTOSH, MACINTOSH_DYLD, MINGW32, MINGW64, MINIX, MORPHOS, MPE_IX, MS_DOS, NACL, NEXT, NINTENDO_3DS, NINTENDO_GAMECUBE, NONSTOP, NUCLEUS_RTOS, OPENSERVER, OS_2, OS_400, OS_9, PALM_OS, PDOS, PHOENIX, PLAN_9, PNACL, QNX, SEGA_DREAMCAST, SINIX, SOLARIS, SONY_PS2, SONY_PS3, SONY_PS4, SONY_PS5, SONY_PSP, SONY_VITA, SYGWIN, SYLLABLE, SYMBIAN, SYSTEM_V, TRU64, UCLINUX, ULTRIX, UNICOS, UNICOS_MP, UNIX, UNIXWARE, UTS, UWIN, VMS, VOS, VXWORKS, WINDOWS, WINDOWS_CE, WINDOWS_DESKTOP, WINDOWS_GDK, WINDOWS_NT, WIND_U, XBOX, XBOX_360, XBOX_ONE, XBOX_SERIES, or Z. See example.

#eq
#define XIEITE_PLTF_EQ(type, major, ... /* minor, patch */) /* integer literal (0 or 1) */
Allows two optional arguments for the minor and patch version numbers. Expands to an expression checking whether a platform is the target platform and its version is equal to some value.

#least
#define XIEITE_PLTF_LEAST(type, major, ... /* minor, patch */) /* integer literal (0 or 1) */
Expands to an expression checking whether a platform is the target platform and its version is equal to or greater than some value.

#most
#define XIEITE_PLTF_MOST(type, major, ... /* minor, patch */) /* integer literal (0 or 1) */
Expands to an expression checking whether a platform is the target platform and its version is equal to or less than some value.


Example

int main() {
	std::print("Is target platform Linux? {}\n", XIEITE_PLTF_TYPE_LINUX);
}
Possible output:
Is target platform Linux? 1
[View in Compiler Explorer]