From f6c2ff5905d9a23e7e25c1e1b9d72ec9d6403d3f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 2 Jun 2009 15:11:42 +0000 Subject: [PATCH] Some source code modifications that should help getting tsan_unittest.cpp compiled on Darwin. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10214 --- drd/tests/tsan_thread_wrappers_pthread.h | 12 +++++++----- drd/tests/tsan_unittest.cpp | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drd/tests/tsan_thread_wrappers_pthread.h b/drd/tests/tsan_thread_wrappers_pthread.h index 1b5b3d3131..84ae17ae50 100644 --- a/drd/tests/tsan_thread_wrappers_pthread.h +++ b/drd/tests/tsan_thread_wrappers_pthread.h @@ -51,8 +51,10 @@ #include #include // INT_MAX -#ifdef OS_MACOSX +#ifdef _APPLE_ #include +#define NO_BARRIER +#define NO_TLS #endif #include @@ -105,7 +107,7 @@ class CondVar; #ifndef NO_SPINLOCK /// helgrind does not (yet) support spin locks, so we annotate them. -#ifndef OS_MACOSX +#ifndef _APPLE_ class SpinLock { public: SpinLock() { @@ -150,7 +152,7 @@ class SpinLock { private: OSSpinLock mu_; }; -#endif // OS_MACOSX +#endif // _APPLE_ #endif // NO_SPINLOCK @@ -587,7 +589,7 @@ class BlockingCounter { int AtomicIncrement(volatile int *value, int increment); -#ifndef OS_MACOSX +#ifndef _APPLE_ inline int AtomicIncrement(volatile int *value, int increment) { return __sync_add_and_fetch(value, increment); } @@ -606,7 +608,7 @@ int posix_memalign(void **out, size_t al, size_t size) { *out = memalign(al, size); return (*out == 0); } -#endif // OS_MACOSX +#endif // _APPLE_ #endif // THREAD_WRAPPERS_PTHREAD_H // vim:shiftwidth=2:softtabstop=2:expandtab:foldmethod=marker diff --git a/drd/tests/tsan_unittest.cpp b/drd/tests/tsan_unittest.cpp index 9b31cc4499..dc6f6a759f 100644 --- a/drd/tests/tsan_unittest.cpp +++ b/drd/tests/tsan_unittest.cpp @@ -85,7 +85,7 @@ #include #include -#ifndef OS_MACOSX +#ifndef _APPLE_ #include #endif -- 2.47.3