blob.h: fix endian check
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
407f7a0bb3
commit
9d8f2dd47b
1 changed files with 2 additions and 2 deletions
4
blob.h
4
blob.h
|
@ -26,8 +26,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
|
|
||||||
#if defined(__linux__) || defined(__CYGWIN__)
|
#if defined(__linux__) || defined(__CYGWIN__)
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
|
@ -60,6 +58,8 @@
|
||||||
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
|
||||||
#define cpu_to_be64(x) bswap_64(x)
|
#define cpu_to_be64(x) bswap_64(x)
|
||||||
#define cpu_to_be32(x) bswap_32(x)
|
#define cpu_to_be32(x) bswap_32(x)
|
||||||
#define cpu_to_be16(x) bswap_16(x)
|
#define cpu_to_be16(x) bswap_16(x)
|
||||||
|
|
Loading…
Reference in a new issue