|
From: <sv...@va...> - 2010-04-29 06:28:51
|
Author: bart
Date: 2010-04-29 07:28:43 +0100 (Thu, 29 Apr 2010)
New Revision: 11110
Log:
Replaced most platform-test macros by HAVE_... macros.
Modified:
trunk/drd/tests/annotate_barrier.c
trunk/drd/tests/annotate_rwlock.c
trunk/drd/tests/circular_buffer.c
trunk/drd/tests/pth_inconsistent_cond_wait.c
Modified: trunk/drd/tests/annotate_barrier.c
===================================================================
--- trunk/drd/tests/annotate_barrier.c 2010-04-29 06:22:17 UTC (rev 11109)
+++ trunk/drd/tests/annotate_barrier.c 2010-04-29 06:28:43 UTC (rev 11110)
@@ -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 @@
{
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
Modified: trunk/drd/tests/annotate_rwlock.c
===================================================================
--- trunk/drd/tests/annotate_rwlock.c 2010-04-29 06:22:17 UTC (rev 11109)
+++ trunk/drd/tests/annotate_rwlock.c 2010-04-29 06:28:43 UTC (rev 11110)
@@ -60,7 +60,7 @@
;
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 @@
;
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
Modified: trunk/drd/tests/circular_buffer.c
===================================================================
--- trunk/drd/tests/circular_buffer.c 2010-04-29 06:22:17 UTC (rev 11109)
+++ trunk/drd/tests/circular_buffer.c 2010-04-29 06:28:43 UTC (rev 11110)
@@ -58,7 +58,7 @@
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 void destroy_semaphore(const char* const name, sem_t* p)
{
-#ifdef __APPLE__
+#ifndef HAVE_SEM_INIT
sem_close(p);
sem_unlink(name);
#else
Modified: trunk/drd/tests/pth_inconsistent_cond_wait.c
===================================================================
--- trunk/drd/tests/pth_inconsistent_cond_wait.c 2010-04-29 06:22:17 UTC (rev 11109)
+++ trunk/drd/tests/pth_inconsistent_cond_wait.c 2010-04-29 06:28:43 UTC (rev 11110)
@@ -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 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 void destroy_semaphore(const char* const name, sem_t* p)
{
-#ifdef __APPLE__
+#ifndef HAVE_SEM_INIT
sem_close(p);
sem_unlink(name);
#else
|