首页 > 其他 > 详细

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

时间:2019-08-15 14:51:41      阅读:92      评论:0      收藏:0      [点我收藏+]

转载自 不同操作系统的宏定义区分

#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

 

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

原文:https://www.cnblogs.com/tlz888/p/11357612.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!