[Mono-devel-list] Non GCC compiler patch - uintptr_t

Bernie Solomon bernard at ugsolutions.com
Fri May 23 18:46:33 EDT 2003


My question seems to have generated some discussion.... I asked as I wasn't
sure what people preferred for projects such as this. I can state my own
preference which would be to use intptr_t/uintptr_t as per C99. However some
platforms provide these even without being C99 (e.g. HPUX11, VC7). I think
inttypes.h header is actually better to use than stdint.h.  C99 defines it
to include stdint.h but it actually exists on HPUX but stdint.h doesn't
exist. So using it works on more platforms than real C99 ones. uintptr_t
also exists in VC7 but in stddef.h (at least that is one location). There is
no definition in any VC6 header so that would need to be provided assuming
that compiler must work. I don't know what other platforms/compilers people
actually build on so don't know if introducing this dependency would cause
pain.

Having said all that so far I have actually not found much need for it so
#if's on SIZEOF_VOID_P would work using guint32 or guint64 as necessary
would work too as it is only needed in a few places. Alternatively moving
the definition of mono_i/mono_u to a more general header would work too.

So for the stuff I am putting together I'll use the #if approach for the
moment as it is going to work and doesn't change dependencies on system
headers in any way (not being core to the project I don't think it is my
call to change these for all platforms).

Bernie Solomon







More information about the Mono-devel-list mailing list