[m-dev.] What's the deal with integer types in Mercury's C source.
pbone at csse.unimelb.edu.au
Fri Sep 9 15:37:38 AEST 2011
In C source we often use MR_Integer and MR_Unsigned, these are guaranteed to be
at least pointer-sized. We also use MR_uint_least32_t and friends when we want
something at least that particular size.
I want an integer that is exactly 32 bits on 32 and 64 bit platforms. I'm
trying to make some inline assembler things as compatible as possible with
different C compilers on i386 and x86_64. The assembly code it's self is
compatible with either i386 or x86_64 but I'd also like it's parameter to be
exactly 32 bits to match the operand size I'm using in the assembly code.
How portable is uint32_t? Or should I use some other type to get _exactly_ a
32bit unsigned int?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 490 bytes
Desc: Digital signature
More information about the developers