From: Michihiro NAKAJIMA Date: Thu, 25 Feb 2010 17:49:07 +0000 (-0500) Subject: On Windows, use _mkgmtime64() which is like timegm() function. X-Git-Tag: v3.0.0a~1180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f16db747f01dd15fd54194f5c279ba0399bc4ecc;p=thirdparty%2Flibarchive.git On Windows, use _mkgmtime64() which is like timegm() function. SVN-Revision: 1992 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 85219e0f2..78ca81efc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -423,6 +423,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) +CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64) CHECK_SYMBOL_EXISTS(wmemcmp "wchar.h" HAVE_WMEMCMP) CHECK_SYMBOL_EXISTS(wmemcpy "wchar.h" HAVE_WMEMCPY) diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index 9614c54ab..2669616a2 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -641,6 +641,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ZLIB_H 1 +/* Define to 1 if you have the `_mkgmtime64' function. */ +#cmakedefine HAVE__MKGMTIME64 1 + /* Version number of libarchive as a single integer */ #cmakedefine LIBARCHIVE_VERSION_NUMBER "${LIBARCHIVE_VERSION_NUMBER}" diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c index 591eebead..1694a91a7 100644 --- a/libarchive/archive_read_support_format_iso9660.c +++ b/libarchive/archive_read_support_format_iso9660.c @@ -2798,6 +2798,8 @@ time_from_tm(struct tm *t) #if HAVE_TIMEGM /* Use platform timegm() if available. */ return (timegm(t)); +#elif HAVE__MKGMTIME64 + return (_mkgmtime64(t)); #else /* Else use direct calculation using POSIX assumptions. */ /* First, fix up tm_yday based on the year/month/day. */ diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c index 63d08b1ad..76452c431 100644 --- a/libarchive/archive_read_support_format_xar.c +++ b/libarchive/archive_read_support_format_xar.c @@ -1021,6 +1021,8 @@ time_from_tm(struct tm *t) #if HAVE_TIMEGM /* Use platform timegm() if available. */ return (timegm(t)); +#elif HAVE__MKGMTIME64 + return (_mkgmtime64(t)); #else /* Else use direct calculation using POSIX assumptions. */ /* First, fix up tm_yday based on the year/month/day. */