From 519b5f619baa43f000ad18c079017bea8e7fc06a Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 16 Sep 2014 14:32:09 -0400 Subject: libiberty/mkstemps.c: Include if not available. Attempting to build libiberty on LynxOS-178 fails trying to compile mkstemps.c with the following error: mkstemps.c:84:18: error: storage size of 'tv' isn't known struct timeval tv; ^ This file would normally include to get the type's definition, but unfortunately LynxOS-178 does not want us to use , only . The configure script correctly finds this out and generates a config.h file where HAVE_SYS_TIME_H is undefined: /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_TIME_H */ This patch fixes the build issue by falling back on including if could not be included (and provided that HAVE_TIME_H is defined, of course). libiberty/ChangeLog: * mkstemps.c: #include if HAVE_TIME_H is defined but not HAVE_SYS_TIME_H. --- libiberty/mkstemps.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libiberty/mkstemps.c') diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index a0e68a7..0e06fe1 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -35,6 +35,8 @@ #endif #ifdef HAVE_SYS_TIME_H #include +#elif HAVE_TIME_H +#include #endif #include "ansidecl.h" -- cgit v1.1