in reply to Perl XS portable uint32_t
Specifically it has information about the size of most common C integer types. For instance:
BTW, the same information is available on the Perl side using the Config module.#define INTSIZE 4 /**/ #define LONGSIZE 4 /**/ #define SHORTSIZE 2 /**/
You could also explicitly discard the upper bits from a possible 64bits word using...
and hope that the optimizer removes the superfluous instructions from the final code on 32 bit architecturesv &= 0xffffffff;
|
|---|