1 #define PLATFORM_WINDOWS 1 2 #define PLATFORM_MAC 2 3 #define PLATFORM_UNIX 3 4 5 #if defined(_WIN32) 6 #define PLATFORM PLATFORM_WINDOWS 7 #elif defined(__APPLE__) 8 #define PLATFORM PLATFORM_MAC 9 #else 10 #define PLATFORM PLATFORM_UNIX 11 #endif
以上代码用来区分当前的运行平台是哪个。