[ODE] ODE on x86_64 machine
Jon Watte (ODE)
hplus-ode at mindcontrol.org
Tue Feb 21 11:12:28 MST 2006
The standard guarantees that longs are always >= ints. Int is "the
natural integer machine word" which may or may not be the same size as a
pointer. Up until recently, it has always been true that long can fit a
pointer; that was formalized in the lp64 programming model where long
and pointer are 64 bits; int are 32; short are 16 and char are 8 (else,
how could you get one type per natural alignment size?)
Unfortunately, Microsoft decided to make "long" and "int" be 32 bits,
and "long long" be 64 bits in their 64-bit compiler. This means that the
only standard types you can depend on are now not built-in, but come
from the system includes. size_t (unsigned) and ssize_t/ptrdiff_t (signed).
Cheers,
/ h+
Alex Brown wrote:
> I thought longs were supposed to always be 32 bit and the ints were the
> ones that changed based on the architecture
>
> On 2/21/06, *Jon Watte (ODE)* < hplus-ode at mindcontrol.org
> <mailto:hplus-ode at mindcontrol.org>> wrote:
>
>
>
> Simon Su wrote:
>
> > ODE source code will compile on x86_64 with just
> > editing the file ode/test/test_space.cpp, in line 127
> > and 128, by changing int to long.
>
> If you're making 64-bit edits, I suggest using a specific ptr_int type
> (such as size_t or ssize_t) rather than "long". Microsoft, in their
> infinite wisdom, decided that "long" is 32 bits even on 64-bit
> platforms, breaking all existing lp64 code :-(
>
> > Is there a type that I can change udword to for x86_64
> > to compile just like the int to long change?
>
> Someone looked at this a while back, and got reasonable results, IIRC.
> You may want to search the list archives for "udword" and "opcode".
>
> Cheers,
>
> / h+
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org <mailto:ODE at q12.org>
> http://q12.org/mailman/listinfo/ode
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list