|
From: <sv...@va...> - 2007-10-06 11:49:13
|
Author: sewardj
Date: 2007-10-06 12:49:11 +0100 (Sat, 06 Oct 2007)
New Revision: 6959
Log:
Compilation fixes for older glibcs.
Modified:
branches/THRCHECK/thrcheck/tc_intercepts.c
branches/THRCHECK/thrcheck/tests/tc10_rec_lock.c
branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.c
Modified: branches/THRCHECK/thrcheck/tc_intercepts.c
===================================================================
--- branches/THRCHECK/thrcheck/tc_intercepts.c 2007-10-05 11:24:28 UTC (rev 6958)
+++ branches/THRCHECK/thrcheck/tc_intercepts.c 2007-10-06 11:49:11 UTC (rev 6959)
@@ -106,11 +106,15 @@
long,_err, char*,_errstr); \
} while (0)
+
+/* Needed for older glibcs (2.3 and older, at least) who don't
+ otherwise "know" about pthread_rwlock_anything or about
+ PTHREAD_MUTEX_RECURSIVE (amongst things). */
+#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
-
-#define __USE_UNIX98 1
#include <pthread.h>
Modified: branches/THRCHECK/thrcheck/tests/tc10_rec_lock.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc10_rec_lock.c 2007-10-05 11:24:28 UTC (rev 6958)
+++ branches/THRCHECK/thrcheck/tests/tc10_rec_lock.c 2007-10-06 11:49:11 UTC (rev 6959)
@@ -1,25 +1,14 @@
/* Do simple things with a recursive mutex. */
+/* Needed for older glibcs (2.3 and older, at least) who don't
+ otherwise "know" about pthread_rwlock_anything or about
+ PTHREAD_MUTEX_RECURSIVE (amongst things). */
+#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-
-
-
-/* glibc 2.3 doesn't appear to supply PTHREAD_MUTEX_RECURSIVE.
- We have to give up. */
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)
-int main ( void ) {
- printf("This program does not compile on systems "
- "using glibc 2.3 or earlier.\n");
- return 0;
-}
-#else
-
-
-
-#define __USE_UNIX98 1
#include <pthread.h>
void nearly_main ( void )
@@ -58,6 +47,3 @@
nearly_main();
return 0;
}
-
-
-#endif /* !(glibc 2.3 or earlier) */
Modified: branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.c 2007-10-05 11:24:28 UTC (rev 6958)
+++ branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.c 2007-10-06 11:49:11 UTC (rev 6959)
@@ -1,4 +1,9 @@
+/* Needed for older glibcs (2.3 and older, at least) who don't
+ otherwise "know" about pthread_rwlock_anything or about
+ PTHREAD_MUTEX_RECURSIVE (amongst things). */
+#define _GNU_SOURCE 1
+
#include <stdio.h>
#include <pthread.h>
#include <assert.h>
|