summaryrefslogtreecommitdiff
path: root/gnulib-m4/getlocalename_l.m4
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:50 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:50 +0100
commitff33e1d252f46bec1a33e28700da3282fc24047a (patch)
tree5c15bc695be820b393a8496c5807ecafbbdeb89b /gnulib-m4/getlocalename_l.m4
parentb2ac982cc8b5290699eb5f52fb043d3d15e2624b (diff)
parent5f59a34ab747dde8ede7357f3431bf06bd6002fe (diff)
Update upstream source from tag 'upstream/1.4.2'
Update to upstream version '1.4.2' with Debian dir 493e96bcd865e4f9990e20bee26408c96231d727
Diffstat (limited to 'gnulib-m4/getlocalename_l.m4')
-rw-r--r--gnulib-m4/getlocalename_l.m425
1 files changed, 21 insertions, 4 deletions
diff --git a/gnulib-m4/getlocalename_l.m4 b/gnulib-m4/getlocalename_l.m4
index 629e510b..2b648ee4 100644
--- a/gnulib-m4/getlocalename_l.m4
+++ b/gnulib-m4/getlocalename_l.m4
@@ -1,6 +1,6 @@
# getlocalename_l.m4
-# serial 4
-dnl Copyright (C) 2025 Free Software Foundation, Inc.
+# serial 5
+dnl Copyright (C) 2025-2026 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.
@@ -30,6 +30,8 @@ AC_DEFUN_ONCE([gl_FUNC_GETLOCALENAME_L_UNSAFE],
if test $ac_cv_func_getlocalename_l = yes; then
dnl Check against the Cygwin 3.6.0 bug: It returns an invalid pointer when
dnl the second argument is LC_GLOBAL_LOCALE.
+ dnl Check against a Haiku >= hrev59293 oddity: It returns "POSIX" instead
+ dnl of "C". We prefer "C".
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([whether getlocalename_l works],
[gl_cv_func_getlocalename_l_works],
@@ -39,14 +41,29 @@ AC_DEFUN_ONCE([gl_FUNC_GETLOCALENAME_L_UNSAFE],
#include <string.h>
int main ()
{
- const char *ret = getlocalename_l (LC_COLLATE, LC_GLOBAL_LOCALE);
- return strlen (ret) == 0;
+ int result = 0;
+ /* Check against the Cygwin bug. */
+ {
+ const char *ret = getlocalename_l (LC_COLLATE, LC_GLOBAL_LOCALE);
+ if (strlen (ret) == 0)
+ result |= 1;
+ }
+ /* Check against the Haiku oddity. */
+ {
+ const char *ret =
+ getlocalename_l (LC_COLLATE, newlocale (LC_ALL_MASK, "C", NULL));
+ if (strcmp (ret, "C") != 0)
+ result |= 2;
+ }
+ return result;
}]])],
[gl_cv_func_getlocalename_l_works=yes],
[gl_cv_func_getlocalename_l_works=no],
[case "$host_os" in
cygwin*) # Guess no on Cygwin.
gl_cv_func_getlocalename_l_works="guessing no" ;;
+ haiku*) # Guess no on Haiku.
+ gl_cv_func_getlocalename_l_works="guessing no" ;;
*) # Guess yes otherwise.
gl_cv_func_getlocalename_l_works="guessing yes" ;;
esac