You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG: Fix order of Windows OS detection macros. (#24762)
* BUG: Fix order of Windows OS detection macros.
- The order should be `__MINGW32__/__MINGW64__`, then `_WIN64`,
and then `_WIN32`.
64 bit MinGW compilers define `_MINGW32__`, `__MINGW64__`, `_WIN32`, and `_WIN64`.
32 bit MinGW compilers define `__MINGW32__`, and `_WIN32`.
64 bit MSVC compilation defines `_WIN32` and `_WIN64`.
32 bit MSVC compilation defines `_WIN32`.
- Fixes#24761.
* Adjust the structure slightly and add comments.
- This is better than just relying on the order of evaluation in the whole
chain. Once Windows is detected (`_WIN32`), handle the possible known
Windows environments separately.
* Remove check for non-standard macros.
- `WIN32`, `__WIN32__`, `WIN64`, `__WIN64__` are not standard macros defined
by Window compilers.
It should be enough to check for `_WIN32` and `_WIN64` alone.
0 commit comments