[cfe-dev] clang with pthread on mingw

Vincent Richomme forumer at smartmobili.com
Sun Feb 14 06:09:04 PST 2010


On Sun, 14 Feb 2010 14:26:38 +0100, Vincent Richomme
<forumer at smartmobili.com> wrote:
> Hi,
> 
> When testing clang on mingw platform I got some errors when pthread was
> enabled.
> Problem was in line 87 in RWMutex.cpp:
> 
>  // Initialize the rwlock
>     errorcode = pthread_rwlock_init(rwlock, &attr);
>     assert(errorcode == 0);
> 
> 
> on mingw platform, pthread only support NULL attribues as shown below:
> 
> int
> pthread_rwlock_init (pthread_rwlock_t * rwlock,
> 		     const pthread_rwlockattr_t * attr)
> {
>   int result;
>   pthread_rwlock_t rwl = 0;
> 
>   if (rwlock == NULL)
>     {
>       return EINVAL;
>     }
> 
>   if (attr != NULL && *attr != NULL)
>     {
>       result = EINVAL;		/* Not supported */
>       goto DONE;
>     }
> 
> ...
> }
> 
> Could someone add a #ifdef to pass NULL when __MINGW32__ is defined.
> 

I have opened a bug report and provided a fix :
http://llvm.org/bugs/show_bug.cgi?id=6297




More information about the cfe-dev mailing list