Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
[Freeciv-Dev] policy: #includes
Home

[Freeciv-Dev] policy: #includes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] policy: #includes
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 18 Jul 1999 13:37:29 +1000 (EST)

There have been a few submitted patches recently which have not 
followed the current (implicit) structure for #include lines, 
so I thought I'd explain that structure explicitly here, and 
request people follow it.  

This info should probably be added to freeciv_hackers_guide.txt
and/or http://www.freeciv.org/contribute.html (section V).
Or of course feel free to debate this policy.

>>>>
The structure of include lines should be follows, with a blank
line between each group.  

  <> config.h, if required, protected by #ifdef HAVE_CONFIG_H
  <> Standard (ISO/ANSI C) system headers
  <> Non-ANSI system headers (ideally these should probably be
     protected by configure checks)
  <> Client GUI system headers (X11,Xaw,xpm; Gtk+)
  "" Freeciv headers from common/ (in alphabetical order)
  "" Freeciv headers from server/ (in alphabetical order)
  "" Freeciv headers from ai/     (in alphabetical order)
  "" Freeciv client headers       (in alphabetical order)
  "" The header file corresponding to the current .c file
  "" Non-header includes, eg bitmaps and icons

Notes:

- A main reason for grouping and ordering the freeciv header in
cludes is so that it is easy to find out whether a given header 
is already included, because one knows exactly where it should 
appear.  

- The header file corresponding to the current .c file is 
separate, so that it is easy to ensure that it is included 
(to check prototypes etc).

- An exception to the above is made for canvas.h and pixcomm.h
in the Xaw client; these are placed just after the system GUI 
headers, on the basis that canvas and pixcomm are effectively 
extensions to Xaw.

- If following this structure results in compile errors or
warnings, that probably indicates a problem with some of the
headers, and should be investigated and/or reported.
<<<<

Any questions, clarifications, suggestions, etc?

Regards,
-- David

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] policy: #includes, David Pfitzner <=