summaryrefslogtreecommitdiff
path: root/lib/Support/Unix/Unix.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2012-04-23 19:00:27 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2012-04-23 19:00:27 +0000
commit8dab5047999c57cdcf24ff04e20a1f2c9a100d8f (patch)
treebb33cac3a0b8e0a43728b690278af7adf358d9d0 /lib/Support/Unix/Unix.h
parent216432df5ac897327a0cb6323f08811910481038 (diff)
downloadllvm-8dab5047999c57cdcf24ff04e20a1f2c9a100d8f.tar.gz
llvm-8dab5047999c57cdcf24ff04e20a1f2c9a100d8f.tar.bz2
llvm-8dab5047999c57cdcf24ff04e20a1f2c9a100d8f.tar.xz
[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
Diffstat (limited to 'lib/Support/Unix/Unix.h')
-rw-r--r--lib/Support/Unix/Unix.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Support/Unix/Unix.h b/lib/Support/Unix/Unix.h
index b7be3111d4..361f297d36 100644
--- a/lib/Support/Unix/Unix.h
+++ b/lib/Support/Unix/Unix.h
@@ -44,16 +44,10 @@
#include <assert.h>
#endif
-#ifdef TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
#endif
+#include <time.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>