[PATCH] Cygwin: _endian.h: Add AArch64 implementations for `ntohl` and `ntohs`
Thirumalai Nagalingam
thirumalai.nagalingam@multicorewareinc.com
Wed Jan 7 17:49:35 GMT 2026
Hi Corinna & Jturney ,
> For a bit of future proofing, maybe this should end with
> #else
> #error unknown architecture
> rather than ploughing on to silently return the unmodified x?
>You're right, of course. Thirumalai, if you'd like to add this in another patch, that would be great.
Thanks both for the feedback, I'll send a patch shortly.
> Also, to be hypercorrect (that is, I do not expect anyone to do
> anything about this): since big-endian ARM is a thing (although not
> for Windows) is there a more tightly scoped define we might use here?
>Isn't the aarch64 architecture support on Windows restricted to LE anyway?
Windows on ARM (both 32-bit and 64-bit/ARM64) always runs in little-endian mode.
Regarding a more tightly scoped check, we can use either
`#elif defined(__aarch64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__`
(or)
the compiler-provided `__AARCH64EL__` macro to make the guard more precise.
Which of these would you prefer me to include if we decide to add the
endian-specific check in the upcoming patch?
Thanks,
Thiru
More information about the Cygwin-patches
mailing list