]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Unbreak build on msys.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 6 Apr 2011 13:04:12 +0000 (09:04 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 6 Apr 2011 13:04:12 +0000 (09:04 -0400)
SVN-Revision: 3169

CMakeLists.txt
build/cmake/config.h.in
configure.ac
libarchive/archive.h
libarchive/archive_string.c
libarchive/archive_windows.c

index 16248e345453b9ad669ed41f540f9553a8cd4dff..1977fad237a4bf0ebb7cdb9d84a2a853b762b91e 100644 (file)
@@ -612,7 +612,9 @@ 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(_ctime64_s HAVE__CTIME64_S)
+CHECK_FUNCTION_EXISTS_GLIBC(_free_locale HAVE__FREE_LOCALE)
 CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64)
+CHECK_FUNCTION_EXISTS_GLIBC(_get_current_locale HAVE__GET_CURRENT_LOCALE)
 CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE)
 CHECK_FUNCTION_EXISTS_GLIBC(_localtime64_s HAVE__LOCALTIME64_S)
 CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64)
index c348aa6ad762fcb658e19dbdd33859a2635d0e7a..fb656d13e9998cdc6bc6bec1d203c5a2ad63fb49 100644 (file)
@@ -931,9 +931,15 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have the `_ctime64_s' function. */
 #cmakedefine HAVE__CTIME64_S 1
 
+/* Define to 1 if you have the `_free_locale' function. */
+#cmakedefine HAVE__FREE_LOCALE 1
+
 /* Define to 1 if you have the `_fseeki64' function. */
 #cmakedefine HAVE__FSEEKI64 1
 
+/* Define to 1 if you have the `_get_current_locale' function. */
+#cmakedefine HAVE__GET_CURRENT_LOCALE 1
+
 /* Define to 1 if you have the `_get_timezone' function. */
 #cmakedefine HAVE__GET_TIMEZONE 1
 
index a4535a39111b0c733551c02dd5ec24c1b9db8f34..9c31f17163c793d89194225c6f1c62ee7d79adff 100644 (file)
@@ -445,7 +445,8 @@ AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs])
 AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm])
 AC_CHECK_FUNCS([tzset unsetenv utime utimensat utimes vfork])
 AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy])
-AC_CHECK_FUNCS([_ctime64_s _fseeki64 _get_timezone _localtime64_s _mkgmtime64])
+AC_CHECK_FUNCS([_ctime64_s _free_locale _fseeki64 _get_current_locale])
+AC_CHECK_FUNCS([_get_timezone _localtime64_s _mkgmtime64])
 # detects cygwin-1.7, as opposed to older versions
 AC_CHECK_FUNCS([cygwin_conv_path])
 
index 8879f8664eb9e5c98b65bb31d5416231988ffe4f..bb6a55d401507c4dc2b3be97e676a72724de703b 100644 (file)
@@ -98,7 +98,7 @@
 # define __LA_DECL
 #endif
 
-#if defined(__GNUC__) && __GNUC__ >= 3
+#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__MINGW32__)
 #define        __LA_PRINTF(fmtarg, firstvararg) \
        __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
 #else
index 3987e0e4342e308097dd9da66a162b9830e31865..79c6e5d94d1744362f3389ec39bf56c0c08ad2a7 100644 (file)
@@ -751,9 +751,13 @@ get_current_codepage()
 {
        unsigned codepage;
 
+#if defined(HAVE__GET_CURRENT_LOCALE) && defined(HAVE__FREE_LOCALE)
        _locale_t locale = _get_current_locale();
        codepage = locale->locinfo->lc_codepage;
        _free_locale(locale);
+#else
+       codepage = GetOEMCP();
+#endif
        return (codepage);
 }
 #endif /* defined(_WIN32) && !defined(__CYGWIN__) */
index b6c2045043a2c22dce4194df1fbd908af851de2a..be8c93a68961f3503ed7cad407eb09ed27e836aa 100644 (file)
@@ -122,9 +122,13 @@ get_current_codepage()
 {
        unsigned codepage;
 
+#if defined(HAVE__GET_CURRENT_LOCALE) && defined(HAVE__FREE_LOCALE)
        _locale_t locale = _get_current_locale();
        codepage = locale->locinfo->lc_codepage;
        _free_locale(locale);
+#else
+       codepage = GetOEMCP();
+#endif
        return (codepage);
 }