| 1 | diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c |
| 2 | index 018ea871f9..369b7c5a31 100644 |
| 3 | |
| 4 | |
| 5 | |
| 6 | #include <x86intrin.h> |
| 7 | #endif |
| 8 | |
| 9 | +#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 10 | +#define le32toh(x) (x) |
| 11 | +#define le16toh(x) (x) |
| 12 | +#else |
| 13 | +#define le32toh(x) (__builtin_bswap32(x)) |
| 14 | +#define le16toh(x) (__builtin_bswap16(x)) |
| 15 | +#endif |
| 16 | + |
| 17 | #include "cbmem_util.h" |
| 18 | |
| 19 | #define CBMEM_VERSION "1.2" |