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)
/* 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
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])
# 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
{
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__) */
{
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);
}