]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Changed #if defined(platform) tests into #if defined(HAVE_...) tests.
authorBart Van Assche <bvanassche@acm.org>
Sat, 3 May 2008 09:15:25 +0000 (09:15 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 3 May 2008 09:15:25 +0000 (09:15 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7999

exp-drd/drd_pthread_intercepts.c
exp-drd/tests/recursive_mutex.c

index 5b28d6728c2bb52b997ac835d43e863ab0b21f08..cd642f1a37f25e8648065cbabbd116fb86246707 100644 (file)
@@ -118,9 +118,9 @@ static MutexT pthread_to_drd_mutex_type(const int kind)
     /* PTHREAD_MUTEX_TIMED_NP */
     /* PTHREAD_MUTEX_NORMAL */
   case PTHREAD_MUTEX_DEFAULT:
-# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
+#if defined(HAVE_PTHREAD_MUTEX_ADAPTIVE_NP)
   case PTHREAD_MUTEX_ADAPTIVE_NP:
-# endif
+#endif
     return mutex_type_default_mutex;
   }
   return mutex_type_invalid_mutex;
index b066ea99b4419ff4cf507c7c39a0b985d2a3ed35..ad79b63fd3c992a2ceab0f76bcf4752202dfe172 100644 (file)
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <pthread.h>
+#include "../../config.h"
 
 
 static void lock_twice(pthread_mutex_t* const p)
@@ -21,14 +22,17 @@ int main(int argc, char** argv)
 {
   /* Let the program abort after 3 seconds instead of leaving it deadlocked. */
   alarm(3);
-#if !defined(_AIX)
+
+#if defined(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
   {
     pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
     printf("Recursive mutex (statically initialized).\n");
     lock_twice(&m);
     pthread_mutex_destroy(&m);
-  } 
+  }
+#endif
+#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE_NP)
   {
     pthread_mutex_t m;
     pthread_mutexattr_t attr;
@@ -40,7 +44,9 @@ int main(int argc, char** argv)
     pthread_mutexattr_destroy(&attr);
     lock_twice(&m);
     pthread_mutex_destroy(&m);
-  } 
+  }
+#endif
+#if defined(HAVE_PTHREAD_MUTEX_ERRORCHECK_NP)
   {
     pthread_mutex_t m;
     pthread_mutexattr_t attr;
@@ -51,15 +57,16 @@ int main(int argc, char** argv)
     pthread_mutex_init(&m, &attr);
     pthread_mutexattr_destroy(&attr);
     lock_twice(&m);
-    pthread_mutex_destroy(&m); }
-#endif /* !defined(_AIX) */
+    pthread_mutex_destroy(&m);
+  }
+#endif
   {
     pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
 
     printf("Non-recursive mutex.\n");
     fflush(stdout);
     lock_twice(&m);
-  } 
+  }
   printf("Done.\n");
   return 0;
 }