bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [PATCH] Fix for #43785


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] [PATCH] Fix for #43785
Date: Sat, 07 Feb 2015 10:14:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Tim Ruehsen <address@hidden> writes:

> Fix #43785 for another Solaris issue.
>
> I would like to see this in the next bugfix release.
>
> Do you agree ?
>
> Tim
>
> From 518ed8d07c0a6e441e0a919ba1967d89e0061898 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tim=20R=C3=BChsen?= <address@hidden>
> Date: Thu, 5 Feb 2015 16:05:24 +0100
> Subject: [PATCH] src/wget.h: Fix libintl.h / gettext clash for Solaris
>
> In case --disable-nls is given, we have to include libintl.h before
> out gettext defines because libintl.h will be implicitly included by
> locale.h. And in this case our defines will conflict with libintl.h
> function prototypes.
> ---
>  src/wget.h | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/wget.h b/src/wget.h
> index cddacdc..0b2381d 100644
> --- a/src/wget.h
> +++ b/src/wget.h
> @@ -59,11 +59,14 @@ as that of the covered work.  */
>  /* `gettext (FOO)' is long to write, so we use `_(FOO)'.  If NLS is
>     unavailable, _(STRING) simply returns STRING.  */
>  #if ENABLE_NLS
> -#    include <libintl.h>
> -#    define _(STRING) gettext(STRING)
> +# include <libintl.h>
> +# define _(STRING) gettext(STRING)
>  #else
> -#    define _(STRING) STRING
> -#    define ngettext(STRING1,STRING2,N) STRING2
> +# ifdef solaris
> +#  include <libintl.h>
> +# endif

I would prefer that we don't have OS dependent ifdefs.  What about
redefining "ngettext" as following when !ENABLE_NLS?  Would this be
enough?

# define ngettext(Msgid1, Msgid2, N) \
    ((N) == 1 \
     ? ((void) (Msgid2), (const char *) (Msgid1)) \
     : ((void) (Msgid1), (const char *) (Msgid2)))

Or can't we just "#include <libintl.h>" on all platforms?

Regards,
Giuseppe



reply via email to

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