How to #ifdef by CompilerType ? GCC or VC++

前端 未结 3 1911
灰色年华
灰色年华 2020-12-14 08:45

I used #ifdef Win32 for safe calls alike sprintf_s but now I want to build project with MinGW and it\'s just wrong now. I need to use #ifdef

3条回答
  •  佛祖请我去吃肉
    2020-12-14 09:31

    #ifdef __clang__
    /*code specific to clang compiler*/
    #elif __GNUC__
    /*code for GNU C compiler */
    #elif _MSC_VER
    /*usually has the version number in _MSC_VER*/
    /*code specific to MSVC compiler*/
    #elif __BORLANDC__
    /*code specific to borland compilers*/
    #elif __MINGW32__
    /*code specific to mingw compilers*/
    #endif
    

提交回复
热议问题