summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-11-14 22:10:23 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-11-14 22:10:23 +0000
commitf7228f703886834f5e3822d084481f524f62930f (patch)
tree71d58db5f0607795ee9d49a5a77cde8d3234496b /unittests
parent8aee7d8f9eab71a29f8f3a5a541144bef4fb5ac4 (diff)
downloadllvm-f7228f703886834f5e3822d084481f524f62930f.tar.gz
llvm-f7228f703886834f5e3822d084481f524f62930f.tar.bz2
llvm-f7228f703886834f5e3822d084481f524f62930f.tar.xz
Fix Windows build, don't try to #include <pthread.h> when we know it's not
available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144574 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/ManagedStatic.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Support/ManagedStatic.cpp b/unittests/Support/ManagedStatic.cpp
index f1f03208c1..bfeb0a7b6f 100644
--- a/unittests/Support/ManagedStatic.cpp
+++ b/unittests/Support/ManagedStatic.cpp
@@ -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 @@ using namespace llvm;
namespace {
+#ifdef HAVE_PTHREAD_H
namespace test1 {
llvm::ManagedStatic<int> ms;
void *helper(void*) {
@@ -35,5 +39,6 @@ TEST(Initialize, MultipleThreads) {
pthread_join(t2, NULL);
llvm_stop_multithreaded();
}
+#endif
} // anonymous namespace