[llvm-commits] [llvm] r144574 - /llvm/trunk/unittests/Support/ManagedStatic.cpp

Nick Lewycky nicholas at mxc.ca
Mon Nov 14 14:10:23 PST 2011


Author: nicholas
Date: Mon Nov 14 16:10:23 2011
New Revision: 144574

URL: http://llvm.org/viewvc/llvm-project?rev=144574&view=rev
Log:
Fix Windows build, don't try to #include <pthread.h> when we know it's not
available.

Modified:
    llvm/trunk/unittests/Support/ManagedStatic.cpp

Modified: llvm/trunk/unittests/Support/ManagedStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ManagedStatic.cpp?rev=144574&r1=144573&r2=144574&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ManagedStatic.cpp (original)
+++ llvm/trunk/unittests/Support/ManagedStatic.cpp Mon Nov 14 16:10:23 2011
@@ -8,7 +8,10 @@
 //===----------------------------------------------------------------------===//
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Threading.h"
+#include "llvm/Config/config.h"
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
+#endif
 
 #include "gtest/gtest.h"
 
@@ -16,6 +19,7 @@
 
 namespace {
 
+#ifdef HAVE_PTHREAD_H
 namespace test1 {
   llvm::ManagedStatic<int> ms;
   void *helper(void*) {
@@ -35,5 +39,6 @@
   pthread_join(t2, NULL);
   llvm_stop_multithreaded();
 }
+#endif
 
 } // anonymous namespace





More information about the llvm-commits mailing list