Patchwork [U-Boot] tools: compiler.h: add missing time.h

login
register
mail settings
Submitter Jeroen Hofstee
Date June 25, 2014, 9:02 p.m.
Message ID <1403730141-21701-1-git-send-email-jeroen@myspectrum.nl>
Download mbox | patch
Permalink /patch/364154/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Jeroen Hofstee - June 25, 2014, 9:02 p.m.
genimg_print_time uses time_t, but time.h is never included.
Linux gets away with this since types.h includes time.h.
Explicitly include the header file so building on e.g. FreeBSD
also works.

cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 include/compiler.h | 1 +
 1 file changed, 1 insertion(+)
Tom Rini - July 22, 2014, 7:22 p.m.
On Wed, Jun 25, 2014 at 11:02:21PM +0200, Jeroen Hofstee wrote:

> genimg_print_time uses time_t, but time.h is never included.
> Linux gets away with this since types.h includes time.h.
> Explicitly include the header file so building on e.g. FreeBSD
> also works.
> 
> cc: Tom Rini <trini@ti.com>
> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

Applied to u-boot/master, thanks!

Patch

diff --git a/include/compiler.h b/include/compiler.h
index 0734ed4..9afc11b 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -48,6 +48,7 @@ 
 # include <machine/endian.h>
 typedef unsigned long ulong;
 #endif
+#include <time.h>
 
 typedef uint8_t __u8;
 typedef uint16_t __u16;