当前位置:   article > 正文

不同操作系统相关的宏_操作系统的宏

操作系统的宏
1. win32或者win64

_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
  • 1
  • 2
  • 3
2. linux
#if defined(__linux__)
#define OS_LINUX
#endif
  • 1
  • 2
  • 3
3. macOS
#if defined(__APPLE__)
#define OS_LINUX // macOS does not differ that much from linux
#define OS_MACOS
#endif
  • 1
  • 2
  • 3
  • 4
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.
  • 1
  • 2
  • 3
  • 4
#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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/600660
推荐阅读
相关标签
  

闽ICP备14008679号