From: Bruno Haible <bruno@clisp.org>
Date: Wed, 24 Jul 2024 21:56:33 +0000 (+0200)
Subject: Avoid false localeconv_used_without_requesting_gnulib_module_localeconv.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=91132b444b897e3cdd07a3474b7c10f45f0c6ea4;p=gnulib.git

Avoid false localeconv_used_without_requesting_gnulib_module_localeconv.

* modules/localeconv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/locale.in.h (localeconv): Don't define to
localeconv_used_without_requesting_gnulib_module_localeconv if the
gnulib module 'localeconv' is in use under the same configure.ac.
---

diff --git a/ChangeLog b/ChangeLog
index b4669045f7..772a0193cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-07-24  Bruno Haible  <bruno@clisp.org>
 
+	Avoid false localeconv_used_without_requesting_gnulib_module_localeconv.
+	* modules/localeconv (configure.ac): Invoke gl_MODULE_INDICATOR.
+	* lib/locale.in.h (localeconv): Don't define to
+	localeconv_used_without_requesting_gnulib_module_localeconv if the
+	gnulib module 'localeconv' is in use under the same configure.ac.
+
 	Avoid false gethostname_used_without_requesting_gnulib_module_gethostname.
 	* modules/gethostname (configure.ac): Invoke gl_MODULE_INDICATOR.
 	* lib/unistd.in.h (gethostname): Don't define to
diff --git a/lib/locale.in.h b/lib/locale.in.h
index 1b11a41c4d..db9ae8bb20 100644
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -177,8 +177,10 @@ _GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
 _GL_CXXALIASWARN (localeconv);
 # endif
 #elif @REPLACE_STRUCT_LCONV@
-# undef localeconv
-# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
+# if !GNULIB_LOCALECONV
+#  undef localeconv
+#  define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef localeconv
 # if HAVE_RAW_DECL_LOCALECONV
diff --git a/modules/localeconv b/modules/localeconv
index 04ac36ed79..3f22cafa36 100644
--- a/modules/localeconv
+++ b/modules/localeconv
@@ -16,6 +16,7 @@ AM_COND_IF([GL_COND_OBJ_LOCALECONV], [
   gl_PREREQ_LOCALECONV
 ])
 gl_LOCALE_MODULE_INDICATOR([localeconv])
+gl_MODULE_INDICATOR([localeconv])
 
 Makefile.am:
 if GL_COND_OBJ_LOCALECONV