diff options
Diffstat (limited to 'intl')
-rw-r--r-- | intl/ChangeLog | 6 | ||||
-rw-r--r-- | intl/libgettext.h | 23 |
2 files changed, 20 insertions, 9 deletions
diff --git a/intl/ChangeLog b/intl/ChangeLog index a9eaa79..ca18404 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,9 @@ +2001-12-12 Bruno Haible <bruno@clisp.org> + + * libgettext.h [!ENABLE_NLS]: Cast all function results to + 'const char *'. + Reported by Alexandre Duret-Lutz <duret_g@lrde.epita.fr>. + 2001-12-03 Bruno Haible <bruno@clisp.org> * Makefile.in (install-exec): Don't create an empty libdir. diff --git a/intl/libgettext.h b/intl/libgettext.h index c5be54a..9a67f2d 100644 --- a/intl/libgettext.h +++ b/intl/libgettext.h @@ -27,18 +27,23 @@ #else -# define gettext(Msgid) (Msgid) -# define dgettext(Domainname, Msgid) (Msgid) -# define dcgettext(Domainname, Msgid, Category) (Msgid) +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + 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". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) +# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) -# define textdomain(Domainname) ((char *) (Domainname)) -# define bindtextdomain(Domainname, Dirname) ((char *) (Dirname)) -# define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset)) + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif |