bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

avoid warnings from gettext.h


From: Bruno Haible
Subject: avoid warnings from gettext.h
Date: Fri, 1 May 2009 16:13:43 +0200
User-agent: KMail/1.9.9

On Solaris, when GNU gettext has installed its <libintl.h>, and when an older
Solaris cc is in use, and when NLS is disabled (as in m4-1.4.13), the compiler
gives the following warnings:

"./gettext.h", line 66: warning: macro redefined: gettext
"./gettext.h", line 67: warning: macro redefined: dgettext
"./gettext.h", line 68: warning: macro redefined: dcgettext
"./gettext.h", line 70: warning: macro redefined: ngettext
"./gettext.h", line 74: warning: macro redefined: dngettext
"./gettext.h", line 76: warning: macro redefined: dcngettext
"./gettext.h", line 78: warning: macro redefined: textdomain
"./gettext.h", line 79: warning: macro redefined: bindtextdomain
"./gettext.h", line 81: warning: macro redefined: bind_textdomain_codeset

This fixes it.


2009-05-01  Bruno Haible  <address@hidden>

        Avoid compiler warnings when redefining macros defined by <libintl.h>.
        * lib/gettext.h [!ENABLE_NLS] (gettext, dgettext, dcgettext, ngettext,
        dngettext, dcngettext, textdomain, bindtextdomain,
        bind_textdomain_codeset): Undefine before redefining.

--- lib/gettext.h.orig  2009-05-01 16:08:51.000000000 +0200
+++ lib/gettext.h       2009-05-01 16:08:04.000000000 +0200
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software 
Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -63,21 +63,30 @@
    for invalid uses of the value returned from these functions.
    On pre-ANSI systems without 'const', the config.h file is supposed to
    contain "#define const".  */
+# undef gettext
 # define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
 # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
 # define dcgettext(Domainname, Msgid, Category) \
     ((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
 # define ngettext(Msgid1, Msgid2, N) \
     ((N) == 1 \
      ? ((void) (Msgid2), (const char *) (Msgid1)) \
      : ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
 # define dngettext(Domainname, Msgid1, Msgid2, N) \
     ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
 # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
     ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
+# undef textdomain
 # define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
 # define bindtextdomain(Domainname, Dirname) \
     ((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
 # define bind_textdomain_codeset(Domainname, Codeset) \
     ((void) (Domainname), (const char *) (Codeset))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]