[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pthread: work around winpthread header pollution on mingw
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] pthread: work around winpthread header pollution on mingw |
Date: |
Thu, 23 Jan 2014 09:44:09 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
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.