diff options
| author | Yonggang Luo <[email protected]> | 2022-09-20 16:43:05 +0800 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2022-10-17 10:35:21 +0200 |
| commit | 0e18267a05247b5bda60115270203b4ad3af8e55 (patch) | |
| tree | 4b14d75d4d88d13b30327772cfe74126dce4d6ea /lib | |
| parent | 96263dfee3591a9c732b00a33a4a221b8f01bf46 (diff) | |
Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN
__BYTE_ORDER, __LITTLE_ENDIAN and __BIG_ENDIAN are defined by the
gcc/clang preprocessor. BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN are
defined in <endian.h>.
Signed-off-by: Yonggang Luo <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ChangeLog | 4 | ||||
| -rw-r--r-- | lib/system.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index e4f00a8f..ab555c17 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2022-09-20 Yonggang Luo <[email protected]> + + * system.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN. + 2022-10-16 Yonggang Luo <[email protected]> * system.h: Add sys/mman.h as system dependend header. diff --git a/lib/system.h b/lib/system.h index 48004df1..bbbe06c4 100644 --- a/lib/system.h +++ b/lib/system.h @@ -64,12 +64,12 @@ void error(int status, int errnum, const char *format, ...); exit (EXIT_FAILURE); \ } while (0) -#if __BYTE_ORDER == __LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN # define LE32(n) (n) # define LE64(n) (n) # define BE32(n) bswap_32 (n) # define BE64(n) bswap_64 (n) -#elif __BYTE_ORDER == __BIG_ENDIAN +#elif BYTE_ORDER == BIG_ENDIAN # define BE32(n) (n) # define BE64(n) (n) # define LE32(n) bswap_32 (n) |
