From f754533a67d24c2ee1d0dce1f78caeb376bcafa5 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 12 Jun 2020 22:05:28 -0700 Subject: [PATCH] Update gettext.h to fix warnings when compiling with --disable-nls With the introduction of AX_COMPILE_FLAGS in configure.ac, building with --disable-nls in configuration raises additional warnings. This change updates gettext.h in order to address those warnings. --- gettext.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gettext.h b/gettext.h index 841b072..8192e2e 100644 --- a/gettext.h +++ b/gettext.h @@ -18,6 +18,10 @@ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 +#ifndef ENABLE_NLS +#define ENABLE_NLS 0 +#endif + /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS @@ -66,29 +70,29 @@ # undef gettext # define gettext(Msgid) ((const char *) (Msgid)) # undef dgettext -# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# define dgettext(Domainname, Msgid) (gettext (Msgid)) # undef dcgettext # define dcgettext(Domainname, Msgid, Category) \ - ((void) (Category), dgettext (Domainname, Msgid)) + (dgettext (Domainname, Msgid)) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ - ? ((void) (Msgid2), (const char *) (Msgid1)) \ - : ((void) (Msgid1), (const char *) (Msgid2))) + ? ((const char *) (Msgid1)) \ + : ((const char *) (Msgid2))) # undef dngettext # define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) + (ngettext (Msgid1, Msgid2, N)) # undef dcngettext # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) + (dngettext (Domainname, Msgid1, Msgid2, N)) # undef textdomain # define textdomain(Domainname) ((const char *) (Domainname)) # undef bindtextdomain # define bindtextdomain(Domainname, Dirname) \ - ((void) (Domainname), (const char *) (Dirname)) + (void)((void) (Domainname), (const char *) (Dirname)) # undef bind_textdomain_codeset # define bind_textdomain_codeset(Domainname, Codeset) \ - ((void) (Domainname), (const char *) (Codeset)) + (void)((void) (Domainname), (const char *) (Codeset)) #endif