[Support/Unix] Unconditionally include time.h.

When building LLVM on Linux with libc++ with CMake TIME_WITH_SYS_TIME is
undefined, and HAVE_SYS_TIME_H is defined. This ends up including
sys/time.h but not time.h. Unix/TimeValue.inc requires time.h for asctime_r
and localtime. libstdc++ seems to include time.h anyway, but libc++ does
not.

Fix this by always including time.h

llvm-svn: 155382
This commit is contained in:
Michael J. Spencer 2012-04-23 19:00:27 +00:00
parent 3cc207bbcc
commit 04b795bc1d
1 changed files with 2 additions and 8 deletions

View File

@ -44,16 +44,10 @@
#include <assert.h>
#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
#endif
#include <time.h>
# endif
#endif
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>