Skip to contentSkip to conversation

tools: compiler.h: Fix build on FreeBSD

PATCH New Jeroen Hofstee 2 participants 2 messages Oct 7, 2014 – Oct 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: compiler.h: Fix build on FreeBSD

Commit 832472 "tools: socfpga: Add socfpga preloader signing to mkimage" added tools/socfpga.c which relies on htole32, le32toh and friends. While compiler.h includes these protypes for linux from endian.h, it doesn't do so for FreeBSD. Hence include <sys/endian.h> for FreeBSD.

---
 include/compiler.h | 4 ++++
 1 file changed, 4 insertions(+)
include/compiler.h +4 -0
index 1451916..2103602 100644
@@ -48,6 +48,10 @@
 # include <machine/endian.h>
 typedef unsigned long ulong;
 #endif
+#ifdef __FreeBSD__
+# include <sys/endian.h> /* htole32 and friends */
+#endif
+
 #include <time.h>
 
 typedef uint8_t __u8;
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 tools: compiler.h: Fix build on FreeBSD

Quoted 9 lines · Jeroen Hofstee

Commit 832472 "tools: socfpga: Add socfpga preloader signing to mkimage" added tools/socfpga.c which relies on htole32, le32toh and friends. While compiler.h includes these protypes for linux from endian.h, it doesn't do so for FreeBSD. Hence include <sys/endian.h> for FreeBSD.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141011/dc434e64/attachment.pgp>