#5851: Don't use _configthreadlocale if not provided by CRT (even if declaration is present)

This commit is contained in:
Mike Gelfand 2015-06-01 18:52:14 +00:00
parent ae5755dc1e
commit 5d48c2d3e9
4 changed files with 9 additions and 8 deletions

View File

@ -397,6 +397,7 @@ foreach(H ${NEEDED_HEADERS})
endforeach()
set(NEEDED_FUNCTIONS
_configthreadlocale
canonicalize_file_name
daemon
fallocate64

View File

@ -65,7 +65,7 @@ endmacro()
function(tr_make_id INPUT OVAR)
string(TOUPPER "${INPUT}" ID)
string(REGEX REPLACE "[^A-Z0-9]+" "_" ID "${ID}")
string(REGEX REPLACE "^_+|_+$" "" ID "${ID}")
# string(REGEX REPLACE "^_+|_+$" "" ID "${ID}")
set(${OVAR} "${ID}" PARENT_SCOPE)
endfunction()

View File

@ -107,7 +107,7 @@ AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([stdbool.h xlocale.h])
AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale])
AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
ACX_PTHREAD

View File

@ -53,11 +53,11 @@ struct locale_context
locale_t new_locale;
locale_t old_locale;
#else
#ifdef _WIN32
int old_thread_config;
#if defined (HAVE__CONFIGTHREADLOCALE) && defined (_ENABLE_PER_THREAD_LOCALE)
int old_thread_config;
#endif
int category;
char old_locale[128];
int category;
char old_locale[128];
#endif
};
@ -72,7 +72,7 @@ use_numeric_locale (struct locale_context * context,
#else
#ifdef _WIN32
#if defined (HAVE__CONFIGTHREADLOCALE) && defined (_ENABLE_PER_THREAD_LOCALE)
context->old_thread_config = _configthreadlocale (_ENABLE_PER_THREAD_LOCALE);
#endif
@ -95,7 +95,7 @@ restore_locale (struct locale_context * context)
setlocale (context->category, context->old_locale);
#ifdef _WIN32
#if defined (HAVE__CONFIGTHREADLOCALE) && defined (_ENABLE_PER_THREAD_LOCALE)
_configthreadlocale (context->old_thread_config);
#endif