MSYS2平台变量

您可能需要使用平台检测,以适应MSYS2的行为和默认行为,下面是一些有用的标识符:

IdentifierPlatform(s)Usage
_WIN32mingw, msvcC code (#ifdef ...)
_WIN6464-bit mingw, 64-bit msvcC code (#ifdef ...)
__CYGWIN__msys2, cygwinC code (#ifdef ...)
__MSYS__msys2C code (#ifdef ...)
x86_64-pc-msys264-bit msys2Build scripts (if [ $host = '...' ])
i686-pc-msys232-bit msys2Build scripts (if [ $host = '...' ])
x86_64-w64-mingw3264-bit mingwBuild scripts (if [ $host = '...' ])
i686-w64-mingw3232-bit mingwBuild scripts (if [ $host = '...' ])
cygwinmsys2Python (sys.platform)
win32mingwPython (sys.platform)

关于Zeno Chen

本人涉及的领域较多,杂而不精 程序设计语言: Perl, Java, PHP, Python; 数据库系统: MySQL,Oracle; 偶尔做做电路板的开发,主攻STM32单片机
此条目发表在C/C++分类目录。将固定链接加入收藏夹。