Two related Windows fixes:
* BX_ARCH_64BIT missed MSVC's _M_ARM64 / _M_ARM64EC, so Windows on ARM64 was
treated as a 32-bit architecture. Add them to the 64-bit detection list.
* The 32-bit Windows branch defaulted WINVER / _WIN32_WINNT to 0x0502 (Windows
XP / Server 2003), which predates APIs that modern SDK headers reference
(e.g. the ETW EventRegister/EventWriteTransfer family, only declared for
_WIN32_WINNT >= 0x0600). Raise it to 0x0601 (Windows 7), matching the 64-bit
branch. Combined with the ARM64 detection fix, x86, x64 and ARM64 Windows
targets now all default to a Windows 7 baseline.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 45aaf3cc-900d-442b-a7e5-0fb6d3fe6658
emscripten <= 4.0.23 only defined the lowercase forms (`__EMSCRIPTEN_major__`,
`__EMSCRIPTEN_minor__`, `__EMSCRIPTEN_tiny__`) in `<emscripten/version.h>`.
Starting with 4.0.24 (PR emscripten-core/emscripten#26180), uppercase
became primary and lowercase was kept as deprecated aliases.
bx PR #374 switched all references to the uppercase form, which is the
right forward-looking direction — but it leaves users on emsdk <= 4.0.23
unable to build, because `__EMSCRIPTEN_MAJOR__` is undefined there and
the preprocessor expression `(__EMSCRIPTEN_MAJOR__ * 10000 + …)` evaluates
to 0. That tanks `BX_PLATFORM_EMSCRIPTEN`, which tanks `BX_PLATFORM_POSIX`,
which makes `bx/src/os.cpp` skip its `<time.h>` / `<sched.h>` includes,
which causes the build to fail on `unknown type name 'timespec'`.
Add a small bridge: if the uppercase macros aren't defined but the lowercase
ones are, alias the uppercase forms to lowercase. The rest of bx continues
to use uppercase uniformly. Newer emsdk versions are unaffected (the bridge
block is skipped because uppercase is already defined).
Co-authored-by: Shuang Liu <[email protected]>