summaryrefslogtreecommitdiff
path: root/include/compiler.h
diff options
context:
space:
mode:
authorJustin Hibbits <chmeeedalf@gmail.com>2018-01-29 22:23:36 -0600
committerTom Rini <trini@konsulko.com>2018-02-05 20:58:11 -0500
commitf29aa23b54e26d212cc61c07bcbb66ed5d6f9704 (patch)
treea1875839d1407be990f50809870ee19237c896a4 /include/compiler.h
parenta4fa8114632a008735142b12a29de1771a115209 (diff)
Fix FreeBSD endian checks
FreeBSD, like OpenBSD, uses BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER, whereas Linux and compatibles use __-prefixed names. Define the names the same as the OpenBSD block below it.
Diffstat (limited to 'include/compiler.h')
-rw-r--r--include/compiler.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/compiler.h b/include/compiler.h
index a43fb6a738..957f4b5d49 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -50,6 +50,9 @@ typedef unsigned long ulong;
#endif
#ifdef __FreeBSD__
# include <sys/endian.h> /* htole32 and friends */
+# define __BYTE_ORDER BYTE_ORDER
+# define __LITTLE_ENDIAN LITTLE_ENDIAN
+# define __BIG_ENDIAN BIG_ENDIAN
#elif defined(__OpenBSD__)
# include <endian.h>
# define __BYTE_ORDER BYTE_ORDER