[U-Boot] [PATCH] Fix FreeBSD endian checks

Justin Hibbits chmeeedalf at gmail.com
Tue Jan 30 04:23:36 UTC 2018


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.
---
 include/compiler.h | 3 +++
 1 file changed, 3 insertions(+)

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
-- 
2.15.1



More information about the U-Boot mailing list