Commit a91e007
sys.h: Detect little endian when compiling with MSVC
This commit adds detection for endianness with MSVC - MSVC does not
define __BYTE_ORDER__, and, hence our current detection does not capture it.
MSVC currently supports 3 platforms: x86, x86_64, and AArch64
(AArch32 was recently removed in VS 2026 18.0)
See
https://learn.microsoft.com/en-us/cpp/overview/supported-platforms-visual-cpp
x86 and x86_64 are always little endian.
AArch64 can be either little endian or big endian, but MSVC/Windows only
supports little endian:
https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions
For AArch32, I can't find explicit statements that MSVC was always limited
to little endian, so I've commited that.
See
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros
Resolves #620
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>1 parent b3f5140 commit a91e007
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
| |||
0 commit comments