Skip to content

Commit

Permalink
Merge branch 'singlekey-endian' of https://github.com/jamessan/kitty
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 23, 2022
2 parents bcedbe5 + b45dc20 commit 61ceb12
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kitty/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 61ceb12

Please sign in to comment.