Fix endianness bug reported in issue #8548

This commit is contained in:
Pranav P 2025-05-21 13:02:11 +05:30
parent af1075c3f6
commit afd0bacb6a

View file

@ -48,8 +48,15 @@ static_assert(sizeof(GPUCell) == 20, "Fix the ordering of GPUCell");
typedef union CPUCell {
struct {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
char_type ch_or_idx: sizeof(char_type) * 8 - 1;
char_type ch_is_idx: 1;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
char_type ch_is_idx: 1;
char_type ch_or_idx: sizeof(char_type) * 8 - 1;
#else
#error "Unsupported endianness"
#endif
char_type hyperlink_id: sizeof(hyperlink_id_type) * 8;
char_type next_char_was_wrapped : 1;
char_type is_multicell : 1;