From: Bart Van Assche Date: Sat, 5 Mar 2011 14:11:40 +0000 (+0000) Subject: DRD tests: replaced __APPLE__ by VGO_darwin. X-Git-Tag: svn/VALGRIND_3_7_0~640 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5ce3a89fb3ea5a0d823903ce851d9e017aa870a;p=thirdparty%2Fvalgrind.git DRD tests: replaced __APPLE__ by VGO_darwin. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11589 --- diff --git a/drd/tests/circular_buffer.c b/drd/tests/circular_buffer.c index 68035215c5..dcfc6115a8 100644 --- a/drd/tests/circular_buffer.c +++ b/drd/tests/circular_buffer.c @@ -59,7 +59,7 @@ int fetch_and_add(int* p, int i) 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 sem_t* create_semaphore(const char* const name, const int value) static void destroy_semaphore(const char* const name, sem_t* p) { -#ifdef __APPLE__ +#ifdef VGO_darwin sem_close(p); sem_unlink(name); #else diff --git a/drd/tests/memory_allocation.c b/drd/tests/memory_allocation.c index 1072489d0c..d6d6388236 100644 --- a/drd/tests/memory_allocation.c +++ b/drd/tests/memory_allocation.c @@ -26,7 +26,7 @@ int main() * 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 diff --git a/drd/tests/pth_inconsistent_cond_wait.c b/drd/tests/pth_inconsistent_cond_wait.c index 618b5401aa..ccfbc3a20b 100644 --- a/drd/tests/pth_inconsistent_cond_wait.c +++ b/drd/tests/pth_inconsistent_cond_wait.c @@ -44,7 +44,7 @@ static int s_quiet; 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 sem_t* create_semaphore(const char* const name) static void destroy_semaphore(const char* const name, sem_t* p) { -#ifdef __APPLE__ +#ifdef VGO_darwin sem_close(p); sem_unlink(name); #else diff --git a/drd/tests/tsan_thread_wrappers_pthread.h b/drd/tests/tsan_thread_wrappers_pthread.h index cfb9b3cd27..7072fead1c 100644 --- a/drd/tests/tsan_thread_wrappers_pthread.h +++ b/drd/tests/tsan_thread_wrappers_pthread.h @@ -51,7 +51,7 @@ #include #include // INT_MAX -#ifdef __APPLE__ +#ifdef VGO_darwin #include #define NO_BARRIER #define NO_TLS @@ -106,7 +106,7 @@ class CondVar; #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 @@ class SpinLock { private: OSSpinLock mu_; }; -#endif // __APPLE__ +#endif // VGO_darwin #endif // NO_SPINLOCK @@ -589,7 +589,7 @@ class BlockingCounter { 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 @@ int posix_memalign(void **out, size_t al, size_t size) { *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 diff --git a/drd/tests/tsan_unittest.cpp b/drd/tests/tsan_unittest.cpp index 6ba123d762..57357a3371 100644 --- a/drd/tests/tsan_unittest.cpp +++ b/drd/tests/tsan_unittest.cpp @@ -93,7 +93,7 @@ static inline void IGNORE_RETURN_VALUE(T v) #include #include -#ifndef __APPLE__ +#ifndef VGO_darwin #include #endif @@ -4786,7 +4786,7 @@ void Run() { // 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