Is `_WIN32` set for cross builds?
`_WIN32` is set in compiler which targets Windows platform - no header or IDE is required. You can verify that using `cc -dM -E - < /dev/null | grep WIN32` command.
Yep, looks good. This is in a Docker container running the image we use in CI for cross-compilation: ``` root@470e6364089b:/build# x86_64-w64-mingw32-gcc -dM -E - < /dev/null | grep WIN32 #define __WIN32__ 1 #define _WIN32 1 #define WIN32 1 #define __WIN32 1 ```
And natively in MSYS2 on Windows: ``` $ cc -dM -E - < /dev/null | grep WIN32 137:#define __WIN32__ 1 183:#define _WIN32 1 301:#define WIN32 1 325:#define __WIN32 1 ```