|
From: <sv...@va...> - 2011-03-05 14:11:49
|
Author: bart
Date: 2011-03-05 14:11:40 +0000 (Sat, 05 Mar 2011)
New Revision: 11589
Log:
DRD tests: replaced __APPLE__ by VGO_darwin.
Modified:
trunk/drd/tests/circular_buffer.c
trunk/drd/tests/memory_allocation.c
trunk/drd/tests/pth_inconsistent_cond_wait.c
trunk/drd/tests/tsan_thread_wrappers_pthread.h
trunk/drd/tests/tsan_unittest.cpp
Modified: trunk/drd/tests/circular_buffer.c
===================================================================
--- trunk/drd/tests/circular_buffer.c 2011-03-05 12:12:04 UTC (rev 11588)
+++ trunk/drd/tests/circular_buffer.c 2011-03-05 14:11:40 UTC (rev 11589)
@@ -59,7 +59,7 @@
static sem_t* create_semaphore(const char* const name, const int value)
{
-#ifdef __APPLE__
+#ifdef VGO_darwin
sem_t* p = sem_open(name, O_CREAT, 0600, value);
return p;
#else
@@ -72,7 +72,7 @@
static void destroy_semaphore(const char* const name, sem_t* p)
{
-#ifdef __APPLE__
+#ifdef VGO_darwin
sem_close(p);
sem_unlink(name);
#else
Modified: trunk/drd/tests/memory_allocation.c
===================================================================
--- trunk/drd/tests/memory_allocation.c 2011-03-05 12:12:04 UTC (rev 11588)
+++ trunk/drd/tests/memory_allocation.c 2011-03-05 14:11:40 UTC (rev 11589)
@@ -26,7 +26,7 @@
* is zero, while Darwin's C library returns a non-NULL pointer. Both are
* allowed by POSIX.
*/
-#if defined(__APPLE__)
+#if defined(VGO_darwin)
if (p)
free(p);
#else
Modified: trunk/drd/tests/pth_inconsistent_cond_wait.c
===================================================================
--- trunk/drd/tests/pth_inconsistent_cond_wait.c 2011-03-05 12:12:04 UTC (rev 11588)
+++ trunk/drd/tests/pth_inconsistent_cond_wait.c 2011-03-05 14:11:40 UTC (rev 11589)
@@ -44,7 +44,7 @@
static sem_t* create_semaphore(const char* const name)
{
-#ifdef __APPLE__
+#ifdef VGO_darwin
sem_t* p = sem_open(name, O_CREAT, 0600, 0);
return p;
#else
@@ -57,7 +57,7 @@
static void destroy_semaphore(const char* const name, sem_t* p)
{
-#ifdef __APPLE__
+#ifdef VGO_darwin
sem_close(p);
sem_unlink(name);
#else
Modified: trunk/drd/tests/tsan_thread_wrappers_pthread.h
===================================================================
--- trunk/drd/tests/tsan_thread_wrappers_pthread.h 2011-03-05 12:12:04 UTC (rev 11588)
+++ trunk/drd/tests/tsan_thread_wrappers_pthread.h 2011-03-05 14:11:40 UTC (rev 11589)
@@ -51,7 +51,7 @@
#include <stdio.h>
#include <limits.h> // INT_MAX
-#ifdef __APPLE__
+#ifdef VGO_darwin
#include <libkern/OSAtomic.h>
#define NO_BARRIER
#define NO_TLS
@@ -106,7 +106,7 @@
#ifndef NO_SPINLOCK
/// helgrind does not (yet) support spin locks, so we annotate them.
-#ifndef __APPLE__
+#ifndef VGO_darwin
class SpinLock {
public:
SpinLock() {
@@ -151,7 +151,7 @@
private:
OSSpinLock mu_;
};
-#endif // __APPLE__
+#endif // VGO_darwin
#endif // NO_SPINLOCK
@@ -589,7 +589,7 @@
int AtomicIncrement(volatile int *value, int increment);
-#ifndef __APPLE__
+#ifndef VGO_darwin
inline int AtomicIncrement(volatile int *value, int increment) {
return __sync_add_and_fetch(value, increment);
}
@@ -608,7 +608,7 @@
*out = memalign(al, size);
return (*out == 0);
}
-#endif // __APPLE__
+#endif // VGO_darwin
#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 2011-03-05 12:12:04 UTC (rev 11588)
+++ trunk/drd/tests/tsan_unittest.cpp 2011-03-05 14:11:40 UTC (rev 11589)
@@ -93,7 +93,7 @@
#include <stdlib.h>
#include <dirent.h>
-#ifndef __APPLE__
+#ifndef VGO_darwin
#include <malloc.h>
#endif
@@ -4786,7 +4786,7 @@
// but the files are actually the same (symlinked).
sprintf(out_name, "/tmp/racecheck_unittest_out.%d", getpid());
fd_out = creat(out_name, O_WRONLY | S_IRWXU);
-#ifdef __APPLE__
+#ifdef VGO_darwin
// symlink() is not supported on Darwin. Copy the output file name.
strcpy(in_name, out_name);
#else
|