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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory.Berkolaiko@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9881) fc_types.h
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 30 Aug 2004 22:36:27 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: >

Gregory Berkolaiko wrote:
> <URL: >
> On Mon, 30 Aug 2004, Jason Short wrote:
>><URL: >
>>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.

If you create an entirely empty .c file that includes a single header 
file, that .c file should compile (no matter which header file you choose).

>>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.

Generally I agree with you.  But I don't think fc_types should get too big.


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9881) fc_types.h, Jason Short <=