Fix test suite on big endian platforms#1001
Conversation
| I forgot endian.h isn't portable so I'll have to take another pass at this at some point. |
| Question about this, why would checking endian at compile time address it? |
| #include <cstring> | ||
| #include <limits> | ||
| extern "C" { | ||
| #include <endian.h> |
There was a problem hiding this comment.
https://github.com/mikepb/endian.h/blob/0f885cbba627efe9b8f763e1c2872e904fe0c0b1/endian.h has equivalents to endian.h for abunch of platforms, if you're still interested in completing this.
(I'd certainly love to see this get fixed here!)
Bitfields themselves work on any system.
...but they're being used within a (The perfectly-correct way of implementing this, without relying on implementation-defined behaviour, would prolly be to drop the
If you lie to the compiler about your system's endianness, then you should expect the compiled program to misbehave. No surprise there. :) |
Fixes #897