diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2021-10-26 03:08:27 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-10-26 05:39:41 +0200 |
commit | 3930198dc9a0720a2b6561c67e55859ec51b73f9 (patch) | |
tree | 1515d8636e9879992791fd5db55d3fd6b5f19f2b /tools/lib/bpf/btf.c | |
parent | libbpf: Fix endianness detection in BPF_CORE_READ_BITFIELD_PROBED() (diff) | |
download | linux-3930198dc9a0720a2b6561c67e55859ec51b73f9.tar.xz linux-3930198dc9a0720a2b6561c67e55859ec51b73f9.zip |
libbpf: Use __BYTE_ORDER__
Use the compiler-defined __BYTE_ORDER__ instead of the libc-defined
__BYTE_ORDER for consistency.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211026010831.748682-3-iii@linux.ibm.com
Diffstat (limited to 'tools/lib/bpf/btf.c')
-rw-r--r-- | tools/lib/bpf/btf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index ef924fc2c911..0c628c33e23b 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -538,9 +538,9 @@ int btf__set_pointer_size(struct btf *btf, size_t ptr_sz) static bool is_host_big_endian(void) { -#if __BYTE_ORDER == __LITTLE_ENDIAN +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return false; -#elif __BYTE_ORDER == __BIG_ENDIAN +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ return true; #else # error "Unrecognized __BYTE_ORDER__" |