From b0afb8fe0ff1d87165af9df61501197a06240dda Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 28 Dec 2025 12:13:40 +0100 Subject: Sync with Gnulib stable-202507 code (a8ac9f9ce5) --- gl/m4/locale_h.m4 | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'gl/m4/locale_h.m4') diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4 index cd1c81ec..e1afbc16 100644 --- a/gl/m4/locale_h.m4 +++ b/gl/m4/locale_h.m4 @@ -1,9 +1,10 @@ # locale_h.m4 -# serial 31 -dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. +# serial 37 +dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_LOCALE_H], [ @@ -19,6 +20,26 @@ AC_DEFUN_ONCE([gl_LOCALE_H], AC_REQUIRE([gl_STDDEF_H]) AC_REQUIRE([gl_LOCALE_T]) + dnl On native Windows, there is a type '_locale_t' that can be used to + dnl define locale_t. + AC_CACHE_CHECK([whether locale.h defines _locale_t], + [gl_cv_header_locale_has_windows_locale_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + _locale_t x;]], + [[]])], + [gl_cv_header_locale_has_windows_locale_t=yes], + [gl_cv_header_locale_has_windows_locale_t=no]) + ]) + if test $gl_cv_header_locale_has_windows_locale_t = yes; then + HAVE_WINDOWS_LOCALE_T=1 + AC_DEFINE([HAVE_WINDOWS_LOCALE_T], [1], + [Define to 1 if defines the _locale_t type.]) + else + HAVE_WINDOWS_LOCALE_T=0 + fi + AC_SUBST([HAVE_WINDOWS_LOCALE_T]) dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv' dnl only if _LCONV_C99 is defined. @@ -86,7 +107,7 @@ AC_DEFUN_ONCE([gl_LOCALE_H], # include #endif ]], - [setlocale newlocale duplocale freelocale]) + [setlocale newlocale duplocale freelocale getlocalename_l]) ]) dnl Checks to determine whether the system has the locale_t type, @@ -130,6 +151,7 @@ AC_DEFUN([gl_LOCALE_T], fi fi AC_SUBST([HAVE_XLOCALE_H]) + AC_SUBST([HAVE_LOCALE_T]) ]) # gl_LOCALE_MODULE_INDICATOR([modulename]) @@ -154,7 +176,11 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NEWLOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREELOCALE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOCALENAME_L]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOCALENAME_L_UNSAFE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS]) @@ -164,14 +190,16 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS], AC_DEFUN([gl_LOCALE_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE]) - HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) - HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE]) - REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) - REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) - REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE]) - REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) - REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE]) - REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) + HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE]) + HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) + HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE]) + HAVE_GETLOCALENAME_L=1; AC_SUBST([HAVE_GETLOCALENAME_L]) + REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) + REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) + REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE]) + REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) + REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE]) + REPLACE_GETLOCALENAME_L=0; AC_SUBST([REPLACE_GETLOCALENAME_L]) + REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS]) ]) -- cgit v1.2.3-74-g34f1