+2019-12-18 Bruno Haible <bruno@clisp.org>
+
+ hard-locale: Avoid test failure on Haiku.
+ * tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD.
+
2019-12-18 Bruno Haible <bruno@clisp.org>
setlocale-null: Handle NULL result from setlocale.
* lib/setlocale_null.c (setlocale_null_unlocked): Handle NULL result
from setlocale or _wsetlocale.
-2019-12-18 Bruno Haible <bruno@clisp.org>
-
- hard-locale: Make multithread-safe.
- * lib/hard-locale.h (hard_locale): Move documentation to here.
- * lib/hard-locale.c: Don't include <stdlib.h>.
- (GLIBC_VERSION): Remove macro.
- (hard_locale): Assume that all systems name the "C" and "POSIX" locales
- "C" or "POSIX". Invoke setlocale_null instead of setlocale.
- * modules/hard-locale (Depends-on): Remove strdup. Add setlocale-null.
-
2019-12-18 Bruno Haible <bruno@clisp.org>
hard-locale: Add test.
/* musl libc has special code for the C.UTF-8 locale; other than that,
all locale names are accepted and all locales are trivial.
OpenBSD returns the locale name that was set, but we don't know how it
- behaves under the hood. */
-#if defined MUSL_LIBC || defined __OpenBSD__
+ behaves under the hood. Likewise for Haiku. */
+#if defined MUSL_LIBC || defined __OpenBSD__ || defined __HAIKU__
expected = true;
#else
expected = !all_trivial;
expected = false;
#elif defined MUSL_LIBC
expected = strcmp (name, "C.UTF-8") != 0;
-#elif defined __OpenBSD__ && HAVE_DUPLOCALE /* OpenBSD >= 6.2 */
+#elif (defined __OpenBSD__ && HAVE_DUPLOCALE) || defined __HAIKU__ /* OpenBSD >= 6.2, Haiku */
expected = true;
#else
expected = !all_trivial;