|
From: <sv...@va...> - 2009-06-02 15:11:51
|
Author: bart
Date: 2009-06-02 16:11:42 +0100 (Tue, 02 Jun 2009)
New Revision: 10214
Log:
Some source code modifications that should help getting tsan_unittest.cpp compiled on Darwin.
Modified:
trunk/drd/tests/tsan_thread_wrappers_pthread.h
trunk/drd/tests/tsan_unittest.cpp
Modified: trunk/drd/tests/tsan_thread_wrappers_pthread.h
===================================================================
--- trunk/drd/tests/tsan_thread_wrappers_pthread.h 2009-06-02 15:03:44 UTC (rev 10213)
+++ trunk/drd/tests/tsan_thread_wrappers_pthread.h 2009-06-02 15:11:42 UTC (rev 10214)
@@ -51,8 +51,10 @@
#include <stdio.h>
#include <limits.h> // INT_MAX
-#ifdef OS_MACOSX
+#ifdef _APPLE_
#include <libkern/OSAtomic.h>
+#define NO_BARRIER
+#define NO_TLS
#endif
#include <string>
@@ -105,7 +107,7 @@
#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 @@
private:
OSSpinLock mu_;
};
-#endif // OS_MACOSX
+#endif // _APPLE_
#endif // NO_SPINLOCK
@@ -587,7 +589,7 @@
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 @@
*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
Modified: trunk/drd/tests/tsan_unittest.cpp
===================================================================
--- trunk/drd/tests/tsan_unittest.cpp 2009-06-02 15:03:44 UTC (rev 10213)
+++ trunk/drd/tests/tsan_unittest.cpp 2009-06-02 15:11:42 UTC (rev 10214)
@@ -85,7 +85,7 @@
#include <stdlib.h>
#include <dirent.h>
-#ifndef OS_MACOSX
+#ifndef _APPLE_
#include <malloc.h>
#endif
|