[Freeciv-Dev] Re: (PR#11248) connection.h and spaceship.h should require
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11248 >
Frédéric Brière wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=11248 >
>
> Just spent two hours tracking down this little bugger: there's some
> voodoo in config.h that allows the packing of bools, and not including
> it will affect the layout of struct connection and struct
> player_spaceship. See attached for a demonstration:
The rule is that every .c file should include config.h *before*
including any other .h files.
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
Don't include <config.h> in your .h files as that can hide errors. But
you may add a
#ifdef HAVE_CONFIG_H
#ifndef FC_CONFIG_H /* this should be defined in config.h */
#error Files including fcintl.h should also include config.h directly
#endif
#endif
as is done in shared.h and fcintl.h, to catch any errors.
-jason
- [Freeciv-Dev] Re: (PR#11248) connection.h and spaceship.h should require config.h,
Jason Short <=
|
|