]> Savannah Git Hosting - gnulib.git/commitdiff
locale: Support several gnulib-tool invocations better.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Dec 2024 10:14:20 +0000 (11:14 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Dec 2024 14:27:21 +0000 (15:27 +0100)
* lib/locale.in.h (_GL_ALREADY_INCLUDING_LOCALE_H): Rename to a macro
that depends on GUARD_PREFIX.
(struct lconv): Avoid duplicate definition.

ChangeLog
lib/locale.in.h

index 8ca0aaff70190f102f6353e1fcd1072a8db3a212..dd1a475415ff661b8c0617cc484252322cb5daa1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-24  Bruno Haible  <bruno@clisp.org>
+
+       locale: Support several gnulib-tool invocations better.
+       * lib/locale.in.h (_GL_ALREADY_INCLUDING_LOCALE_H): Rename to a macro
+       that depends on GUARD_PREFIX.
+       (struct lconv): Avoid duplicate definition.
+
 2024-12-24  Bruno Haible  <bruno@clisp.org>
 
        limits-h: Support several gnulib-tool invocations better.
index db9ae8bb2080424f2226c8065f0a71ae4bf563ce..c9958f8e484f96eb1e485ca298998560e7bd6e4b 100644 (file)
@@ -20,7 +20,7 @@
 @PRAGMA_COLUMNS@
 
 #if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
-    || defined _GL_ALREADY_INCLUDING_LOCALE_H
+    || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_LOCALE_H
 
 /* Special invocation convention:
    - Inside mingw header files,
 
 #ifndef _@GUARD_PREFIX@_LOCALE_H
 
-#define _GL_ALREADY_INCLUDING_LOCALE_H
+#define _@GUARD_PREFIX@_ALREADY_INCLUDING_LOCALE_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
 
-#undef _GL_ALREADY_INCLUDING_LOCALE_H
+#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_LOCALE_H
 
 #ifndef _@GUARD_PREFIX@_LOCALE_H
 #define _@GUARD_PREFIX@_LOCALE_H
@@ -83,7 +83,8 @@
 
 /* Bionic libc's 'struct lconv' is just a dummy.  */
 #if @REPLACE_STRUCT_LCONV@
-# define lconv rpl_lconv
+# if !defined GNULIB_defined_struct_lconv
+#  define lconv rpl_lconv
 struct lconv
 {
   /* All 'char *' are actually 'const char *'.  */
@@ -160,6 +161,8 @@ struct lconv
      number.  */
   char int_n_sep_by_space;
 };
+#  define GNULIB_defined_struct_lconv 1
+# endif
 #endif
 
 #if @GNULIB_LOCALECONV@
@@ -309,4 +312,4 @@ _GL_WARN_ON_USE (freelocale, "freelocale is not portable");
 
 #endif /* _@GUARD_PREFIX@_LOCALE_H */
 #endif /* _@GUARD_PREFIX@_LOCALE_H */
-#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
+#endif /* !(__need_locale_t || _@GUARD_PREFIX@_ALREADY_INCLUDING_LOCALE_H) */