diff options
author | Eric Blake <eblake@redhat.com> | 2010-06-02 11:08:06 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-06-02 14:12:18 -0600 |
commit | df6774c09485e6b0f31f4659eb55d50c68c008a8 (patch) | |
tree | 0e506564b8d6f58d55f66474b922f9957e56ae71 /modules/time | |
parent | 2988c8c21303fdadb3a9efe321870d96f6bdc668 (diff) | |
download | gnulib-df6774c09485e6b0f31f4659eb55d50c68c008a8.tar.gz |
time: work with mingw + pthreads-win32 library
When using the pthreads-win32 library with mingw, struct timespec
is available in <pthread.h>. Meanwhile, that header has some
rather buggy macros for localtime_r and gmtime_r that interfere
with proper gnulib replacement header actions.
Tested in a cross-compilation environment: Fedora 13 with mingw32-gcc
and mingw32-pthreads installed.
* m4/time_h.m4 (gl_CHECK_TYPE_STRUCT_TIMESPEC): Set new variable
if timespec is defined only in pthread.h.
* modules/time (Makefile.am): Substitute it.
* lib/time.in.h (!TIME_H_DEFINES_STRUCT_TIMESPEC): Include
<pthread.h>, when needed.
(GNULIB_TIME_R): Undefine broken localtime_r and gmtime_r macros
from the library.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'modules/time')
-rw-r--r-- | modules/time | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/time b/modules/time index 52336ed020..22ddd0f2e0 100644 --- a/modules/time +++ b/modules/time @@ -40,6 +40,7 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ |