And, you can't get typedefs that depend on architecture with the preprocessor. Instead use this;
Code:
template<int bit_size> struct Helper
{
};
template<> struct Helper<16>
{
typedef int16_t intw;
typedef uint16_t uintw;
};
template<> struct Helper<32>
{
typedef int32_t intw;
typedef uint32_t uintw;
};
template<> struct Helper<64>
{
typedef int64_t intw;
typedef uint64_t uintw;
};
typedef Helper<sizeof(void *)*CHAR_BIT>::intw intw;
typedef Helper<sizeof(void *)*CHAR_BIT>::uintw uintw;
This, of course, relies on the types intXX_t and uintXX_t types being declared on your target system - which is not guaranteed either, IIRC.