On 01/23/2014 05:38 AM, Eric Blake wrote:

> diff --git a/lib/pthread.in.h b/lib/pthread.in.h

> +/* The pthreads-win32 <pthread.h> defines a couple of broken macros.  */
> +#undef asctime_r
> +#undef ctime_r
> +#undef gmtime_r
> +#undef localtime_r
> +#undef rand_r
> +#undef strtok_r

> diff --git a/m4/pthread.m4 b/m4/pthread.m4

> +     # mingw 3.0 uses winpthreads which installs broken macros via 
> <pthread.h>
> +     AC_CACHE_CHECK([whether <pthread.h> pollutes the namespace],
> +      [gl_cv_header_pthread_h_pollution],
> +      [AC_COMPILE_IFELSE(
> +        [AC_LANG_PROGRAM(
> +          [[#include <pthread.h>
> +            #ifdef strtok_r
> +            #error
> +             break me
> +            #endif
> +          ]])],
> +        [gl_cv_header_pthread_h_pollution=no],
> +        [gl_cv_header_pthread_h_pollution=yes])])

Would it be worth defining MINGW_PTHREAD_H_POLLUTION here
for use as a guard for the undefs in pthread.in.h
in case those were valid defines on some platform?
I'm not suggesting just curious.

Anyway the fix makes sense and looks good.

thanks,
Pádraig.

Reply via email to