Where is WIN32 defined, and how can I include this definition in my project?

后端 未结 6 1003
逝去的感伤
逝去的感伤 2021-01-11 21:06

I am including a third party header and source file into my project.

At the top of the header there is this:

#if defined(WIN32) || defined(WIN16)
#i         


        
6条回答
  •  清酒与你
    2021-01-11 21:21

    Visual Studio has the built-in define _WIN32. mingw-gcc has WIN32 and _WIN32 built-in so the project was likely tested using gcc. You might add

    
    #if defined(_WIN32) && !defined(WIN32)
    #define WIN32
    #endif
    

    or just add a -DWIN32 to the CFLAGS.

提交回复
热议问题