So, you will need to define your own types, e.g.
Code:
typedef int int32;
typedef short int int16;
And then where these types do not match your particular criteria, you will need some sort of #if solution to declare the appropriate type, e.g.
Code:
#if __X64__
typedef long int int64;
#else
typedef long long int int64;
#endif
I would also add a piece of code that does like this (somewhere in the early part of the code, e.g. in main):
Code:
if (sizeof(int32) != 4) { printf("sizeof(int32) is not 4, it is %d\n", (int)sizeof(int32)); }
That way, if the sizes do get messed up, you know about it, rather than trying to figure out why everything behaves a bit strange.
--
Mats
--
Mats