It looks like impossible to create macro wrappers around L, UL, LL, ULL, i64 and ui64 suffixes for 32-bit and 64-bit constants. If you declare a macro as follows:
...
#define _ULL ULL
...
and then use it:
...
unsigned __int64 ui64ValueULL = 4_ULL;
...
you could get a compilation error 'Bad suffix on number', or similar.
It is a problem when different C/C++ compilers are used to compile sources for different 16-bit ( embedded ), 32-bit ( desktop / embedded ) and 64-bit ( desktop ) platforms.
I see that the best solution in case of highly portable C/C++ codes is Do Not Use L, UL, LL, ULL, i64 and ui64 at all.
Here is a simple test-case:
#if ( defined ( _WIN32_ICC ) || defined ( _WIN32_MSC ) || defined ( _WIN32CE_MSC ) )
_int32 i32ValueL = 1L;
unsigned __int32 ui32ValueUL = 2UL;
__int64 i64ValueLL = 3LL;
unsigned __int64 ui64ValueULL = 4ULL;
__int64 i64Valuei64 = 5i64;
unsigned __int64 ui64Valueui64 = 6ui64;
#endif
#if ( defined ( _WIN32_MGW ) )
__int32 i32ValueL = 1L;
unsigned __int32 ui32ValueUL = 2UL;
__int64 i64ValueLL = 3LL;
unsigned __int64 ui64ValueULL = 4ULL;
__int64 i64Valuei64 = 5; // Doesn't support i64 suffix ( a compilation error )
unsigned __int64 ui64Valueui64 = 6; // Doesn't support ui64 suffix ( a compilation error )
#endif
#if ( defined ( _WIN32_BCC ) )
__int32 i32ValueL = 1L;
unsigned __int32 ui32ValueUL = 2UL;
__int64 i64ValueLL = 3; // Doesn't support LL suffix ( a compilation error )
unsigned __int64 ui64ValueULL = 4; // Doesn't support ULL suffix ( a compilation error )
__int64 i64Valuei64 = 5i64;
unsigned __int64 ui64Valueui64 = 6ui64;
#endif
#if ( defined ( _COS16_TCC ) )
__int32 i32ValueL = 1L;
unsigned __int32 ui32ValueUL = 2UL;
__int64 i64ValueLL = 3; // Doesn't support LL suffix ( a compilation error )
unsigned __int64 ui64ValueULL = 4; // Doesn't support ULL suffix ( a compilation error )
__int64 i64Valuei64 = 5; // Doesn't support i64 suffix ( a compilation error )
unsigned __int64 ui64Valueui64 = 6; // Doesn't support ui64 suffix ( a compilation error )
#endif
and absolutely postable solution is:
...
__nt32 i32ValueL = 1;
unsigned __int32 ui32ValueUL = 2;
__int64 i64ValueLL = 3;
unsigned __int64 ui64ValueULL = 4;
__int64 i64Valuei64 = 5;
unsigned __int64 ui64Valueui64 = 6;
...
Any comments?