Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为了处理 Mac 和 Windows 之间的平台特定代码,WIN32和APPLE是要使用的术语,对吗?
因此,thw 代码如下所示:
#ifdef _WIN32 // Windows code #endif #ifdef __APPLE__ // Mac code #endif
Linux 呢?
我怎样才能为这三个人做到这一点?正确的
It's similar:
#ifdef __linux__ // Linux code #endif
Since you are going to have either one of these three defined at a time, this should be ok for all three.
List of defines.