Add differing integer types for integers with different endianess.

This is inspired by the Linux kernel source code, and reduces
endianess-related bugs.
This commit is contained in:
2026-01-22 12:20:54 +01:00
parent 1400e93b6d
commit 44b3af2b46

View File

@@ -23,6 +23,19 @@ typedef __SIZE_TYPE__ usize;
typedef __INTPTR_TYPE__ intptr; typedef __INTPTR_TYPE__ intptr;
typedef __UINTPTR_TYPE__ uintptr; typedef __UINTPTR_TYPE__ uintptr;
#ifdef __CHECKER__
#define BITWISE __attribute__((bitwise))
#else
#define BITWISE
#endif
typedef u16 BITWISE be16;
typedef u32 BITWISE be32;
typedef u64 BITWISE be64;
typedef u16 BITWISE le16;
typedef u32 BITWISE le32;
typedef u64 BITWISE le64;
#if __SIZEOF_SIZE_T__ == __SIZEOF_LONG_LONG__ #if __SIZEOF_SIZE_T__ == __SIZEOF_LONG_LONG__
typedef llong ssize; typedef llong ssize;
#elif __SIZEOF_SIZE_T__ == __SIZEOF_LONG__ #elif __SIZEOF_SIZE_T__ == __SIZEOF_LONG__