From b8a8c7bc682b7ababe4a98dbd64b618c1e955f65 Mon Sep 17 00:00:00 2001 From: jb Date: Mon, 10 Nov 2014 00:17:16 +0000 Subject: PR 47007 and 61847 Locale failures in libgfortran. 2014-11-10 Janne Blomqvist PR libfortran/47007 PR libfortran/61847 * config.h.in: Regenerated. * configure: Regenerated. * configure.ac (AC_CHECK_HEADERS_ONCE): Check for xlocale.h. (AC_CHECK_FUNCS_ONCE): Check for newlocale, freelocale, uselocale, strerror_l. * io/io.h (locale.h): Include. (xlocale.h): Include if present. (c_locale): New variable. (old_locale): New variable. (old_locale_ctr): New variable. (old_locale_lock): New variable. (st_parameter_dt): Add old_locale member. * io/transfer.c (data_transfer_init): Set locale to "C" if doing formatted transfer. (finalize_transfer): Reset locale to previous. * io/unit.c (c_locale): New variable. (old_locale): New variable. (old_locale_ctr): New variable. (old_locale_lock): New variable. (init_units): Init c_locale, init old_locale_lock. (close_units): Free c_locale. * runtime/error.c (locale.h): Include. (xlocale.h): Include if present. (gf_strerror): Use strerror_l if available. Reset locale to LC_GLOBAL_LOCALE for strerror_r branch. 2014-11-10 Janne Blomqvist PR libfortran/47007 PR libfortran/61847 * gfortran.texi: Add note about locale issues to thread-safety section. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217273 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libgfortran/configure.ac') diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index b3150f49c99..f54104bb460 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -255,7 +255,7 @@ AC_CHECK_TYPES([ptrdiff_t]) # check header files (we assume C89 is available, so don't check for that) AC_CHECK_HEADERS_ONCE(unistd.h sys/time.h sys/times.h sys/resource.h \ sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h fenv.h fptrap.h \ -fpxcp.h pwd.h complex.h) +fpxcp.h pwd.h complex.h xlocale.h) GCC_HEADER_STDINT(gstdint.h) @@ -290,7 +290,8 @@ else strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \ getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \ readlink getgid getpid getppid getuid geteuid umask getegid \ - secure_getenv __secure_getenv mkostemp strnlen strndup strtok_r) + secure_getenv __secure_getenv mkostemp strnlen strndup strtok_r newlocale \ + freelocale uselocale strerror_l) fi # Check strerror_r, cannot be above as versions with two and three arguments exist -- cgit v1.2.1