_WIN32 Defined as 1 when the compilation target is 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise, undefined.
_WIN64 Defined as 1 when the compilation target is 64-bit ARM or x64. Otherwise, undefined.
#if defined(_WIN32)
#define OS_WINDOWS
#endif
2. linux
#if defined(__linux__)
#define OS_LINUX
#endif
3. macOS
#if defined(__APPLE__)
#define OS_LINUX // macOS does not differ that much from linux
#define OS_MACOS
#endif
4. QNX
__QNX__
The target is a QNX operating system (QNX 4, QNX Neutrino, or BlackBerry PlayBook OS).
__QNXNTO__
The target is the QNX Neutrino RTOS or BlackBerry PlayBook OS.
#if defined(__QNX__)
/* QNX-specific (any flavor) code here */
#if defined(__QNXNTO__)
/* QNX Neutrino-specific code here */
#else
/* QNX 4-specific code here */
#endif
#endif