bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [PATCH] Let's get rid of gettext.h


From: Tim Ruehsen
Subject: Re: [Bug-wget] [PATCH] Let's get rid of gettext.h
Date: Fri, 28 Nov 2014 11:30:31 +0100
User-agent: KMail/4.14.2 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

We do not need gettext.h.
We only need _() and libintl.h inclusion.

Here is a patch to address that.

Please review and comment.

Tim


On Thursday 27 November 2014 23:26:51 Darshit Shah wrote:
> And that is precisely why I've been gunning for getting a good CI setup in
> place.
> 
> The above patch worked for me flawlessly, but is causing problems on the
> MSVC compiler.
> 
> Thanking You,
> Darshit Shah
> Sent from mobile device. Please excuse my brevity
> 
> On 27-Nov-2014 11:01 pm, "Gisle Vanem" <address@hidden> wrote:
> > The recent change [1] to gettext.h of replacing free() with
> > 
> > xfree() has generated many warnings on MSVC:
> >   cl -nologo -MD ... -c cookies.c
> >   g:\mingw32\src\inet\wget\src\gettext.h(218) : warning C4013: 'xfree'
> 
> undefined;
> 
> >   assuming extern returning int
> > 
> > The cause is in "gettext.h" (the package from Hell IMHO.
> > "gettext.h" is included in "wget.h" before "utils.h" which
> > 
> > defines xfree):
> >  #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
> >  
> >   (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
> >   
> >    /* || __STDC_VERSION__ >= 199901L */ )
> > 
> > I.e. GNU only. So what to do? Here I just did:
> >   @@ -176,6 +176,7 @@
> >   
> >    #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
> >    #include <stdlib.h>
> >   
> >   +#define xfree free
> >   
> >    #endif
> 
> That is exactly how we otherwise define xfree. Maybe the definition should
> be moved to a more appropriate place so that MSVC doesn't complain?
> 
> > Wasn't there an alloca() discussion recently? Why not use
> > that instead? far more portable IMHO.
> 
> If I remember right, we decided against using alloca because of some issues
> with alloca.h not being available on some architectures.
> 
> > [1]: 2014-11-27  Darshit Shah  <address@hidden>
> > 
> >         * cookies.c, gettext.h, init.c, retr.c, url.c, warc.c: Replace
> 
> usage of
> 
> >         free() with xfree() macro.
> > 
> > --
> > --gv
> 
> @Tim, your idea about a docker setup would really help us in these cases.
> See if you can set it up sometime soon. We'll hopefully incorporate it
> after the v1.16.1 release.

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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