What's the difference between the WIN32 and _WIN32 defines in C++

前端 未结 3 885
孤街浪徒
孤街浪徒 2020-11-30 03:04

I know that WIN32 denotes win32 compilation but what is _WIN32 used for?

3条回答
  •  悲&欢浪女
    2020-11-30 03:35

    WIN32 is a user-defined flag which may be required by some headers. _WIN32 is automatically defined by the visual C/C++ compiler. Since it begins with an _ followed by a capital character, it is reserved by the implementation (meaning the C/C++ toolchain provider).

    I prefer to use (read) _WIN32, seems safer to me.

提交回复
热议问题