From: Michael J. Spencer Date: Mon, 23 Apr 2012 19:00:27 +0000 (+0000) Subject: [Support/Unix] Unconditionally include time.h. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8dab5047999c57cdcf24ff04e20a1f2c9a100d8f;p=oota-llvm.git [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155382 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/Unix/Unix.h b/lib/Support/Unix/Unix.h index b7be3111d43..361f297d364 100644 --- a/lib/Support/Unix/Unix.h +++ b/lib/Support/Unix/Unix.h @@ -44,16 +44,10 @@ #include #endif -#ifdef TIME_WITH_SYS_TIME +#ifdef HAVE_SYS_TIME_H # include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif +#include #ifdef HAVE_SYS_WAIT_H # include