C++代码中的平台判断

1.MSVC

#ifndef _MSC_VER

#endif

2.WINDOWS

#if defined(__WINDOWS__) || defined(_WIN32) || defined(WIN32) || defined(_WIN64) || \
    defined(WIN64) || defined(__WIN32__) || defined(__TOS_WIN__)

#endif

3.MAC

#if defined(__MACOSX) || defined(__MACOS_CLASSIC__) || defined(__APPLE__) || defined(__apple__)

#endif

4.Linux

#if defined(__linux__) || defined(linux) || defined(__linux) || defined(__LINUX__) || \
    defined(LINUX) || defined(_LINUX)

#endif

你可能感兴趣的:(Zero,Point,One,c++,windows,开发语言)