当前位置:   article > 正文

不同操作系统的宏定义区分_define 区分系统

define 区分系统

#ifdef _WIN32 //define something for Windows (32-bit and 64-bit, this part is common)

    #ifdef _WIN64 //define something for Windows (64-bit only)

    #else //define something for Windows (32-bit only)

    #endif

#elif __APPLE__

    #include "TargetConditionals.h"

    #if TARGET_IPHONE_SIMULATOR // iOS Simulator

    #elif TARGET_OS_IPHONE // iOS device

    #elif TARGET_OS_MAC // Other kinds of Mac OS

    #else

    # error "Unknown Apple platform"

    #endif

#elif __ANDROID__ // android

#elif __linux__ // linux

#elif __unix__ // all unices not caught above // Unix

#elif defined(_POSIX_VERSION) // POSIX

#else# error "Unknown compiler"#endif

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/600644
推荐阅读
相关标签
  

闽ICP备14008679号