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

gnulib-local/lib/gettext.h

index 6d3ffa7078f8d82b1fc314fc945af665d9ee0a3f..e7b1f88b3ac40167a9debcb5ccf753acd76b4ea7 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;