This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] libiberty/mkstemps.c: Include <time.h> if <sys/time.h> not available.


*** TEST RESULTS FOR COMMIT 519b5f619baa43f000ad18c079017bea8e7fc06a ***

Author: Joel Brobecker <brobecker@adacore.com>
Branch: master
Commit: 519b5f619baa43f000ad18c079017bea8e7fc06a

libiberty/mkstemps.c: Include <time.h> if <sys/time.h> 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 <sys/time.h> to get the type's
definition, but unfortunately LynxOS-178 does not want us to use
<sys/time.h>, only <time.h>. 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 <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */

This patch fixes the build issue by falling back on including <time.h>
if <sys/time.h> could not be included (and provided that HAVE_TIME_H
is defined, of course).

libiberty/ChangeLog:

        * mkstemps.c: #include <time.h> if HAVE_TIME_H is defined
        but not HAVE_SYS_TIME_H.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]