[hatari-devel] #include missing?!?
Thomas Huth
huth at users.berlios.de
Sun Sep 26 14:45:40 CEST 2010
On Fri, 24 Sep 2010 22:23:38 +0300
Eero Tamminen <eerot at users.berlios.de> wrote:
> Hi,
>
> On Friday 24 September 2010, Markus Fritze wrote:
> > #include "screen.h"
> >
> > was missing in video.h to compile it on the Mac.
>
> Although some Hatari includes include other headers, Hatari has a
> general policy that header files are included by C-files. Thomas can
> explain why[1].
Including a header file from within another header file can lead to
ugly dependencies in some cases. For example, in the past we had the
problem that main.h #defined BOOL, but this gave a conflict with
windows.h when compiling for Windows. So when a header #included
main.h, it was not usable anymore in any .c file that also tried to
#include windows.h. It was a pain to solve these dependencies, and by
keeping all #include statements in the .c files instead, we have a much
better control for such situations.
> [1] Thomas, maybe you could add short coding Dos & Don'ts text
> under doc/?
Ok, I added a coding.txt file with some points that just came to
my mind. Does that list look reasonable?
Thomas
More information about the hatari-devel
mailing list