Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9881) fc_types.h
Home

[Freeciv-Dev] (PR#9881) fc_types.h

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9881) fc_types.h
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Mon, 30 Aug 2004 22:31:07 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9881 >

On Mon, 30 Aug 2004, Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9878 >
>
> Gregory Berkolaiko wrote:
>
> > 1. The reason I put fc_types.h before any other includes is to indicate
> > that ultimately a header file should only include fc_types.h at most.  But
> > maybe it's a wrong goal.
>
> A header file should include everything it needs to compile.  So if a .c
> file includes this header file only it need include no other headers.
> This is Raimar's argument to which I agree.

I am not sure I understand what you mean.

> fc_types.h is needed to avoid circular dependencies.  But once it exists
> we might as well add more stuff to it.  But we shouldn't add anything
> that requires including another header.

And I am not sure you understood what I meant
Currently (it is my impression that) header files include other header
files to load some specail types, structs and enums.  Sometimes it creates
circular dependencies.  But I think we should put all such commonly used
structs (or forward declarations of them), enums and typedefs into one
file, fc_types.h and then header files will not need to include any other
header files apart from fc_types.h  Which I feel is cleaner but maybe is
too religious.

G.




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9881) fc_types.h, Gregory Berkolaiko <=