summaryrefslogtreecommitdiff
path: root/gnulib-m4/getlocalename_l.m4
diff options
context:
space:
mode:
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