Closed boschmitt closed 2 years ago
Most of the code is not influenced by the endianness. However the combination of bit-filed struct and union is.
For example. Take this code:
union { struct { uint32_t _bits; uint32_t _mask; }; uint64_t _value; };
If we try to change the value of '_bits' using (_value ^ 1), then things will break. This commit adds compile-time macros to identify the endianness of the platform, and change the order of '_bits' and '_mask' accordingly.
Most of the code is not influenced by the endianness. However the combination of bit-filed struct and union is.
For example. Take this code:
If we try to change the value of '_bits' using (_value ^ 1), then things will break. This commit adds compile-time macros to identify the endianness of the platform, and change the order of '_bits' and '_mask' accordingly.