[Mono-devel-list] Correct int type to hold a pointer?

Paolo Molaro lupus at ximian.com
Thu May 22 13:08:09 EDT 2003


On 05/20/03 Bernie Solomon wrote:
> What is the correct int type to use which is big enough to hold a pointer.
> As far as I can tell glib does not have a type like that, (u)intptr_t in
> inttypes.h is the standard but so far this is not included in any other .c
> file so I am not sure it can be used. There is mono_i and mono_u but they
> are only inside interpreter and I am not sure this can/should be included in
> metadata files. My initial need is to fix the cast inside dword_align in
> metadata.c. I could of course use #if SIZEOF_VOID_P tests but that is always
> uglier.

unsigned long should work on all the sane platforms (ie not including
64 bit windows systems, I heard).
I'd go with the #if in dword_align.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list