[ODE] GIMPACT on amd64?

Giel van Schijndel me at mortis.eu
Thu May 24 07:23:16 MST 2007

On Thu, 24 May 2007 05:54:33 -0700 Daniel Coming wrote:
> The issue lies in the hard coded
> #define GUINT_BIT_COUNT 32
> among other defined constants relying on 32-bit, along with
> #define GINT long
> #define GUINT unsigned long
> Now, if you watch the configure script carefully, on your 64-bit
> machine you'll notice
> checking size of long int... 8
> On a 32-bit machine, both int and long were 32 bit, however newer gcc
> versions are
> giving longs 64 bits. So, the quick fix is to change these two longs
> to ints:
> #define GINT int
> #define GUINT unsigned int
> GImpact still needs to update to 64 bit double precision, but for now,
> this should run.
More portable would probably be to use the int32_t and uint32_t types
defined in <stdint.h>.

So an alternative to your fix would be:
#define GINT int32_t
#define GUINT uint32_t

These types are guaranteed to be exactly 32bits long at all times, `int'
is not. `int' is only guaranteed to be _at_least_ 16 bit. `long' however
is guaranteed to be at least 32 bit, so if you need at least 32 bit,
then `long' is safer. If you need exactly 32bit (in a portable way) then
the (u)int32_t types are ^probably^ best.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://ode.org/pipermail/ode/attachments/20070524/8460aa36/signature.bin

More information about the ODE mailing list