diff options
author | Eric Blake <eblake@redhat.com> | 2014-01-22 20:39:45 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2014-01-23 10:55:02 -0700 |
commit | d5fec6c22f03c6a73d62260c9ce091c10c0a9cbd (patch) | |
tree | a304179bfe7a9672b8fe527a92bb337081e8794d /doc | |
parent | 751494621c1d38c012a170d5eb557637ae9179f2 (diff) | |
download | gnulib-d5fec6c22f03c6a73d62260c9ce091c10c0a9cbd.tar.gz |
pthread: work around winpthread header pollution on mingw
Dan Berrange reported compilation failure of libvirt on Fedora 20
when cross-compiling to mingw; the problem was traced to bogus
macros in the winpthreads <pthread.h> header shipped as part of
mingw-headers 3.0.
CC util/libvirt_util_la-virerror.lo
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/sys/time.h:10:0,
from ../gnulib/lib/sys/time.h:39,
from ../gnulib/lib/sys/select.h:117,
from util/virutil.h:31,
from util/virerror.c:35:
../gnulib/lib/time.h:468:21: error: expected identifier or '(' before '{' token
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
^
Gnulib's time.h was already working around the pthread.h pollution,
but now that newer mingw has started providing struct timespec,
the workaround was no longer being hit. Moving the pollution
workaround to the wrapper around the broken header solves the problem.
* lib/time.in.h: Move pthread workarounds...
* lib/pthread.in.h: ...here.
* m4/pthread.m4 (gl_PTHREAD_CHECK): Also build pthread.h when we
detect macro pollution on mingw.
* doc/posix-headers/pthread.texi (pthread.h): Document the problems.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/posix-headers/pthread.texi | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/posix-headers/pthread.texi b/doc/posix-headers/pthread.texi index 5fb1d2e5d4..cb4d2b80a0 100644 --- a/doc/posix-headers/pthread.texi +++ b/doc/posix-headers/pthread.texi @@ -3,15 +3,22 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html} -Gnulib module: --- +Gnulib module: pthread Portability problems fixed by Gnulib: @itemize +@item +This header pollutes the namespace with some broken macro +implementations for various functions such as @code{strtok_r} and +@code{gmtime_r}: +mingw 3.0. @end itemize Portability problems not fixed by Gnulib: @itemize @item -This header file is missing on some platforms: -Minix 3.1.8, mingw, MSVC 9, BeOS. +This header file is missing on some platforms; the replacement does +not offer threads, so much as lightweight stubs that make conditional +compilation easier for fallbacks to single-threaded programs. +Minix 3.1.8, mingw 2.x, MSVC 9, BeOS. @end itemize |