diff mbox

[U-Boot] tools: compiler.h: Fix build on FreeBSD

Message ID 1412714547-27658-1-git-send-email-jeroen@myspectrum.nl
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Jeroen Hofstee Oct. 7, 2014, 8:42 p.m. UTC
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.

Cc: Marek Vasut <marex@denx.de>
CC: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 include/compiler.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Tom Rini Oct. 11, 2014, 11:49 a.m. UTC | #1
On Tue, Oct 07, 2014 at 10:42:27PM +0200, Jeroen Hofstee wrote:

> 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.
> 
> Cc: Marek Vasut <marex@denx.de>
> CC: Tom Rini <trini@ti.com>
> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/include/compiler.h b/include/compiler.h
index 1451916..2103602 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -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;