Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#2306) config.h for all files
Home

[Freeciv-Dev] Re: (PR#2306) config.h for all files

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Short via RT <rt@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2306) config.h for all files
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 13 Nov 2002 21:59:05 +0100

On Wed, Nov 13, 2002 at 12:45:54PM -0800, Jason Short via RT wrote:
> Raimar Falke via RT wrote:
> > On Mon, Nov 11, 2002 at 12:31:42PM -0800, Jason Short via RT wrote:
> > 
> >>Attached is a patch to bring #include <config.h> to every source file.
> >>
> >>In addition to the arguments below, there are some practical reasons why 
> >>this is needed.  Currently config.h #defines 'const', which is used all 
> >>over the place.  If it changes the definition, right now this will 
> >>result in changes in only some places, lots of warnings, and (if the 
> >>definition is necessary) compilation failure.
> > 
> > 
> > Mhhh. Can you explain me this:
> > 
> > --- common/netintf.h    2002/02/14 15:17:16     1.4
> > +++ common/netintf.h    2002/11/13 20:01:58
> > @@ -18,10 +18,6 @@
> >    Common network interface.
> >  ***********************************************************************/
> > 
> > -#ifdef HAVE_CONFIG_H
> > -#include <config.h>
> > -#endif
> > -
> >  #ifdef HAVE_UNISTD_H
> >  #include <unistd.h>
> >  #endif
> 
> The idea is that config.h is included in every .c file, and is therefore 
> not needed in .h files.
> 
> It could be done as you say: include it in every file that "needs" it. 
> But note that this is harder to maintain, since you have to check this 
> periodically and/or remember to change it when the files change.

> And it's not likely to net you much, since with all the .h files
> that need config.h most or all of the .c files will end up getting
> it anyway.

But you _removed_ it from a .h file which clearly needs it!!

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "> WHY?! Isn't it better to put $(shell cat cscope.files) on the list of
  I only have a yellow belt in makefile kungfu.  These fancy gnu make things
  are relatively new to some of us..."
    -- Mark Frazer to Vassilii Khachaturov in linux-kernel


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