Compile failure on win32: __GTHREAD_MUTEX_INIT' was notdeclared in this scope

Per Bothner per@bothner.com
Sat Jan 31 08:27:00 GMT 2004


 >>libstdc++-v3/include/ext/mt_allocator.h:840: error:
 >>`__GTHREAD_MUTEX_INIT' was not declared in this scope

 > This has been reverted at the moment. If you do a cvs update
 > you should be fine.

Huh?  As of 5 minutes ago CVS mainline was broken.
mt_allocator_h line 840 references __GTHREAD_MUTEX_INIT inside an
#ifdef __GTHREADS *only*.  This cannot possibly be correct, given that
at line 696 it is guarded by both #ifdef __GTHREADS *and*
#ifdef __GTHREAD_MUTEX_INIT.

To continue the build I replaced it by:

   template<typename _Tp> __gthread_mutex_t
#ifdef __GTHREAD_MUTEX_INIT
   __mt_alloc<_Tp>::_S_thread_freelist_mutex = __GTHREAD_MUTEX_INIT;
#else
   __mt_alloc<_Tp>::_S_thread_freelist_mutex;
#endif

Presumably there needs to be a call to __GTHREAD_MUTEX_INIT_FUNCTION
somewhere.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Libstdc++ mailing list