Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#11248) connection.h and spaceship.h should require con
Home

[Freeciv-Dev] (PR#11248) connection.h and spaceship.h should require con

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11248) connection.h and spaceship.h should require config.h
From: "Frédéric Brière" <fbriere@xxxxxxxxxxx>
Date: Mon, 29 Nov 2004 02:32:32 -0800
Reply-to: rt@xxxxxxxxxxx

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

root@toroia:/root/freeciv-cvs# gcc -Icommon -Iutility -o foo foo.c && ./foo
1460 208
root@toroia:/root/freeciv-cvs# gcc -DFOO -Icommon -Iutility -o foo foo.c && 
./foo
1456 112


-- 
             Frédéric Brière    <*>    fbriere@xxxxxxxxxxx

 =>  <fbriere@xxxxxxxxxx> IS NO MORE:  <http://www.abacomsucks.com>  <=

#include <stdio.h>

#ifdef FOO
#include "config.h"
#endif

#include "connection.h"
#include "spaceship.h"

int main() {
        printf("%d %d\n", sizeof(struct connection),
                                sizeof(struct player_spaceship));
}


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11248) connection.h and spaceship.h should require config.h, Frédéric Brière <=