]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Put in the proper casts.
authorBruno Haible <bruno@clisp.org>
Thu, 13 Dec 2001 13:22:42 +0000 (13:22 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 21:44:18 +0000 (23:44 +0200)
intl/ChangeLog
intl/libgettext.h

index a9eaa79f8dbd3b00dabbaa1a87881902091b1705..ca18404208d93989895ebfe55dfc269722688c07 100644 (file)
@@ -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.
index c5be54a80af5eb239a5f67622d32135392ea8271..9a67f2d373e7c1b2cedfe334068491c50628ca8a 100644 (file)
 
 #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