]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gettext-h: Fix compilation error on Solaris 11 (regr. 2025-05-28).
authorBruno Haible <bruno@clisp.org>
Sat, 31 May 2025 23:10:06 +0000 (01:10 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 31 May 2025 23:10:33 +0000 (01:10 +0200)
* lib/gettext.h (gettext, dgettext, dcgettext): On Solaris, use 'char *'
as return type.

ChangeLog
lib/gettext.h

index a8b8e8bf6a555acbf9d92c0b1ac1cf47b54cd167..c5edd007b923c468271513fc30956b5555b1612d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-05-31  Bruno Haible  <bruno@clisp.org>
+
+       gettext-h: Fix compilation error on Solaris 11 (regr. 2025-05-28).
+       * lib/gettext.h (gettext, dgettext, dcgettext): On Solaris, use 'char *'
+       as return type.
+
 2025-05-31  Bruno Haible  <bruno@clisp.org>
 
        Make gl_CHECK_FUNCS_MACOS work with current unreleased Autoconf.
index bb3d9755decdf3681cbdae8548cffe4ac33a14d7..7a7f02e3ee73cc3d63e553d3bc6c0b0915e10a0c 100644 (file)
 /* Use inline functions, to avoid warnings
      warning: format not a string literal and no format arguments
    that don't occur with enabled NLS.  */
+/* The return type 'const char *' serves the purpose of producing warnings
+   for invalid uses of the value returned from these functions.  */
 __attribute__ ((__always_inline__, __gnu_inline__)) extern inline
-const char *
+#  if !defined(__sun)
+const
+#  endif
+char *
 gettext (const char *msgid)
 {
   return msgid;
 }
 __attribute__ ((__always_inline__, __gnu_inline__)) extern inline
-const char *
+#  if !defined(__sun)
+const
+#  endif
+char *
 dgettext (const char *domain, const char *msgid)
 {
   (void) domain;
   return msgid;
 }
 __attribute__ ((__always_inline__, __gnu_inline__)) extern inline
-const char *
+#  if !defined(__sun)
+const
+#  endif
+char *
 dcgettext (const char *domain, const char *msgid, int category)
 {
   (void) domain;