Fallback to compiler defines when __BYTE_ORDER is not available#513
Fallback to compiler defines when __BYTE_ORDER is not available#513methane merged 3 commits intomsgpack:mainfrom
Conversation
|
After how |
|
Done, thanks! |
|
Remove this too: |
|
I missed that - updated and retested. |
|
This fix is required on OpenBSD/sparc64 to unbreak borgbackup 1.2.2 at runtime, see borgbackup/borg#6149 (comment) for details. |
|
msgpack-python 1.0.4 regression tests pass 100% with and without this fix on OpenBSD/sparc64. Passing tests but failing runtime consumers at the same time suggests a lack of endianess coverage. |
Can you elaborate why? This include is required by ntohs(3) later in the same file: Accidentially, it seems, this builds fine on OpenBSD, but breaks at least in Ubuntu 20.04, see |
On some systems (I tested it on Oracle Solaris and FreeBSD),
__BYTE_ORDER,__LITTLE_ENDIANand__BIG_ENDIANfromarpa/inet.hare not available, which can cause failures on big endian systems (because little endian is the default). This adds a fallback to common compiler defines in those cases.Addresses issues raised in #495.