* m4/localename.m4 (gl_LOCALENAME): Check for <langinfo.h>.
* lib/localename.c (gl_locale_name_thread_unsafe): Use NL_LOCALE_NAME
on Linux platforms which define NL_LOCALE_NAME.
+2018-02-24 Bruno Haible <bruno@clisp.org>
+
+ localename: Add support for musl libc.
+ * m4/localename.m4 (gl_LOCALENAME): Check for <langinfo.h>.
+ * lib/localename.c (gl_locale_name_thread_unsafe): Use NL_LOCALE_NAME
+ on Linux platforms which define NL_LOCALE_NAME.
+
2018-02-24 Bruno Haible <bruno@clisp.org>
mbrtowc tests: Don't make assumptions about the charset the C locale.
# if defined __APPLE__ && defined __MACH__
# include <xlocale.h>
# endif
-# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || defined __CYGWIN__
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || (defined __linux__ && HAVE_LANGINFO_H) || defined __CYGWIN__
# include <langinfo.h>
# endif
# if !defined IN_LIBINTL
nl_langinfo (_NL_LOCALE_NAME (category)). */
name = thread_locale->__names[category];
return name;
+# elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME
+ /* musl libc */
+ return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale);
# elif (defined __FreeBSD__ || defined __DragonFly__) || (defined __APPLE__ && defined __MACH__)
/* FreeBSD, Mac OS X */
int mask;
-# localename.m4 serial 2
+# localename.m4 serial 3
dnl Copyright (C) 2007, 2009-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,
[
AC_REQUIRE([gt_LC_MESSAGES])
AC_REQUIRE([gt_INTL_MACOSX])
+ AC_CHECK_HEADERS_ONCE([langinfo.h])
AC_CHECK_FUNCS([setlocale uselocale])
dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
dnl it nor the equivalent.