How to tell if you're compiling on Windows? How to tell if you're compiling on Windows? windows windows

How to tell if you're compiling on Windows?


The _WIN32 is always defined on Windows platform, checkout the predefined macros.


It depends on what files are you using.

The compiler itself doesn't have such a flag, but it is common to have such a define in the operating system's SDK.

For example, the CRT has a Win32 define, which affects how it is compiled.