This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51906] thread lock test failures on darwin11 under Xcode 4.2
- From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Jan 2012 22:14:36 +0000
- Subject: [Bug libstdc++/51906] thread lock test failures on darwin11 under Xcode 4.2
- Auto-submitted: auto-generated
- References: <bug-51906-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51906
--- Comment #14 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-01-28 22:14:36 UTC ---
(In reply to comment #13)
I'm not having much luck getting the test case to compile on darwin11. If I
use...
#include <pthread.h>
struct mutex {
pthread_mutex_t m;
} m ;
int main()
{
m.m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
pthread_mutex_lock(&m.m);
}
I still get the compilation error...
pthread_test.c:10: error: expected expression before â{â token
Also, the diff between the pthread.h in SL and Lion shows...
@@ -222,6 +223,11 @@
#define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}}
+#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) ||
defined(_DARWIN_C_SOURCE)
+#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
{_PTHREAD_ERRORCHECK_MUTEX_SIG_init, {0}}
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER
{_PTHREAD_RECURSIVE_MUTEX_SIG_init, {0}}
+#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
+
/*
* Condition variable attributes
*/