[llvm-commits] [llvm] r155382 - /llvm/trunk/lib/Support/Unix/Unix.h
Michael J. Spencer
bigcheesegs at gmail.com
Mon Apr 23 12:00:27 PDT 2012
Author: mspencer
Date: Mon Apr 23 14:00:27 2012
New Revision: 155382
URL: http://llvm.org/viewvc/llvm-project?rev=155382&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Support/Unix/Unix.h
Modified: llvm/trunk/lib/Support/Unix/Unix.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Unix.h?rev=155382&r1=155381&r2=155382&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Unix.h (original)
+++ llvm/trunk/lib/Support/Unix/Unix.h Mon Apr 23 14:00:27 2012
@@ -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>
More information about the llvm-commits
mailing list