While testing a grep snapshot on OpenBSD 6.3, I see a test failure of
test-localename. The cause is that in OpenBSD >= 6.2, the locale_t
type and uselocale() etc. are now available, but with a terribly dumbed-
down implementation that makes it impossible to use these per-thread
locales for anything real (including gettext()).
This patch adjusts the gnulib code so that it treats OpenBSD >= 6.2 like
the platforms without locale_t and uselocale().
2018-12-16 Bruno Haible
localename: Fix test failure on OpenBSD >= 6.2.
* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Test for fake
locale system. Define HAVE_FAKE_LOCALES in this case.
* lib/localename.c (HAVE_GOOD_USELOCALE): New macro. Use it instead of
HAVE_USELOCALE.
* tests/test-localename.c (HAVE_GOOD_USELOCALE): New macro. Use it
instead of HAVE_NEWLOCALE && HAVE_USELOCALE.
* doc/posix-functions/uselocale.texi: Mention OpenBSD problem. Update
platforms list.
* doc/posix-functions/newlocale.texi: Likewise.
* doc/posix-functions/duplocale.texi: Update platforms list.
* doc/posix-functions/freelocale.texi: Likewise.
diff --git a/doc/posix-functions/uselocale.texi
b/doc/posix-functions/uselocale.texi
index 07711df..2d8b947 100644
--- a/doc/posix-functions/uselocale.texi
+++ b/doc/posix-functions/uselocale.texi
@@ -14,5 +14,9 @@ Portability problems not fixed by Gnulib:
@itemize
@item
This function is missing on many platforms:
-Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
+Mac OS X 10.3, FreeBSD 9.0, NetBSD 5.0, OpenBSD 6.1, Minix 3.1.8, AIX 6.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
+@item
+This function is useless because the @code{locale_t} type contains basically
+no information on some platforms:
+OpenBSD 6.3.
@end itemize
diff --git a/doc/posix-functions/newlocale.texi
b/doc/posix-functions/newlocale.texi
index c15b1bd..376f7e8 100644
--- a/doc/posix-functions/newlocale.texi
+++ b/doc/posix-functions/newlocale.texi
@@ -14,5 +14,9 @@ Portability problems not fixed by Gnulib:
@itemize
@item
This function is missing on many platforms:
-Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
+Mac OS X 10.3, FreeBSD 9.0, NetBSD 5.0, OpenBSD 6.1, Minix 3.1.8, AIX 6.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
+@item
+This function is useless because the @code{locale_t} type contains basically
+no information on some platforms:
+OpenBSD 6.3.
@end itemize
diff --git a/doc/posix-functions/duplocale.texi
b/doc/posix-functions/duplocale.texi
index a328a67..000300b 100644
--- a/doc/posix-functions/duplocale.texi
+++ b/doc/posix-functions/duplocale.texi
@@ -21,5 +21,5 @@ Portability problems not fixed by Gnulib:
@itemize
@item
This function is missing on many platforms:
-Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
+Mac OS X 10.3, FreeBSD 9.0, NetBSD 5.0, OpenBSD 6.1, Minix 3.1.8, AIX 6.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
@end itemize
diff --git a/doc/posix-functions/freelocale.texi
b/doc/posix-functions/freelocale.texi
index 50e448e..e4ff00f 100644
--- a/doc/posix-functions/freelocale.texi
+++ b/doc/posix-functions/freelocale.texi
@@ -14,5 +14,5 @@ Portability problems not fixed by Gnulib:
@itemize
@item
This function is missing on many platforms:
-Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
+Mac OS X 10.3, FreeBSD 9.0, NetBSD 5.0, OpenBSD 6.1, Minix 3.1.8, AIX 6.1,
HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11.3, Cygwin, mingw, MSVC 14, Interix
3.5, BeOS, Android 4.4.
@end itemize
diff --git a/m4/intl-thread-locale.m4 b/m4/intl-thread-locale.m4
index d7ad0ac..0666e39 100644
--- a/m4/intl-thread-locale.m4
+++ b/m4/intl-thread-locale.m4
@@ -1,4 +1,4 @@
-# intl-thread-locale.m4 serial 2
+# intl-thread-locale.m4 serial 3
dnl Copyright (C) 2015-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,6 +24,57 @@ AC_DEFUN([gt_INTL_THREAD_LOCALE_NAME],
AC_CHECK_FUNCS_ONCE([uselocale])
+ dnl On OpenBSD >= 6.2, the locale_t type and the uselocale(), newlocale(),
+ dnl duplocale(), freelocale() functions exist but are effectively useless,
+ dnl because the locale_t value depends only on the LC_CTYPE ca