]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Replaced most platform-test macros by HAVE_... macros.
authorBart Van Assche <bvanassche@acm.org>
Thu, 29 Apr 2010 06:28:43 +0000 (06:28 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 29 Apr 2010 06:28:43 +0000 (06:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11110

drd/tests/annotate_barrier.c
drd/tests/annotate_rwlock.c
drd/tests/circular_buffer.c
drd/tests/pth_inconsistent_cond_wait.c

index 914ca924a8415f337face87560d0bf849cd39739..1cbaf237a1409488130854a3711c193f66352aa2 100644 (file)
@@ -12,6 +12,7 @@
 #include <stdlib.h>  /* atoi() */
 #include <string.h>  /* memset() */
 #include "../../drd/drd.h"
+#include "../../config.h"
 
 
 #define BARRIER_SERIAL_THREAD -1
@@ -83,7 +84,7 @@ static int barrier_wait(barrier_t* b)
   {
     while (b->barrier_count == barrier_count)
     {
-#ifdef __APPLE__
+#ifndef HAVE_PTHREAD_YIELD
       /* Darwin doesn't have an implementation of pthread_yield(). */
       usleep(100 * 1000);
 #else
index bc290eeb5d05e62c2f05bc7b6414002f95453b4e..5ebb5fd24dae48e3adece00d0b6bdc4235aff475 100644 (file)
@@ -60,7 +60,7 @@ static void rwlock_rdlock(rwlock_t* p)
       ;
     if (p->writer_count == 0)
       break;
-#ifdef __APPLE__
+#ifndef HAVE_PTHREAD_YIELD
     /* Darwin doesn't have an implementation of pthread_yield(). */
     usleep(100 * 1000);
 #else
@@ -84,7 +84,7 @@ static void rwlock_wrlock(rwlock_t* p)
       ;
     if (p->reader_count == 0)
       break;
-#ifdef __APPLE__
+#ifndef HAVE_PTHREAD_YIELD
     /* Darwin doesn't have an implementation of pthread_yield(). */
     usleep(100 * 1000);
 #else
index 9a7238cb43b74dd81d537c80b2d5e39b7ee9c196..720279422b895579ec4a1d253632ec3d13c9057a 100644 (file)
@@ -58,7 +58,7 @@ int fetch_and_add(int* p, int i)
 
 static sem_t* create_semaphore(const char* const name, const int value)
 {
-#ifdef __APPLE__
+#ifndef HAVE_SEM_INIT
   sem_t* p = sem_open(name, O_CREAT, 0600, value);
   return p;
 #else
@@ -71,7 +71,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__
+#ifndef HAVE_SEM_INIT
   sem_close(p);
   sem_unlink(name);
 #else
index f7501cc25c895f7c7bccb97b1af4906e5dac6219..c5769097ecafe7854d42737a39e2d3f5db7705a9 100644 (file)
@@ -14,6 +14,7 @@
 #include <sys/time.h>  // gettimeofday()
 #include <time.h>      // struct timespec
 #include <unistd.h>
+#include "../../config.h"
 
 
 #define PTH_CALL(expr)                                  \
@@ -42,7 +43,7 @@ static int             s_quiet;
 
 static sem_t* create_semaphore(const char* const name)
 {
-#ifdef __APPLE__
+#ifndef HAVE_SEM_INIT
   sem_t* p = sem_open(name, O_CREAT, 0600, 0);
   return p;
 #else
@@ -55,7 +56,7 @@ static sem_t* create_semaphore(const char* const name)
 
 static void destroy_semaphore(const char* const name, sem_t* p)
 {
-#ifdef __APPLE__
+#ifndef HAVE_SEM_INIT
   sem_close(p);
   sem_unlink(name);
 #else