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
  */

Reply via email to