Define SingleKey bitfields according to endianness

Closes #5802
This commit is contained in:
James McCoy 2022-12-22 15:07:54 -05:00
parent bcedbe5ec1
commit b45dc20693
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -301,9 +301,17 @@ typedef uint64_t keybitfield;
#endif
typedef union Key {
struct {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
keybitfield mods : MOD_BITS;
keybitfield is_native: 1;
keybitfield key : KEY_BITS;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
keybitfield key : KEY_BITS;
keybitfield is_native: 1;
keybitfield mods : MOD_BITS;
#else
#error "Unsupported endianness"
#endif
};
keybitfield val;
} Key;