Predefined Preprocessor Macro to check compiler Architecture in Visual Studio C++. In example below if long was 4 bytes in 32 bit architecture and 8 bytes in 64 bit architecture we can use the macro _M_X64 and _M_IX86 to make sure the unit32 we use is always 4 bytes. Just a note that Visual Studio long is 4 bytes in both 32 and 64 bit I tested and long long is 8 bytes. So it will be no point using this macro in the sample code below but the idea is to know how to use these macros if there was a need.

For more Predefined Preprocessor Macros you can find in MSDN
Preprossor directives:

#ifdef _M_X64
 #define uint32 unsigned int
#elif defined _M_IX86
 #define uint32 unsigned long
 #error Unsupported Architecture

int _tmain(int argc, _TCHAR* argv[])
    uint32 i = 100;
    printf("\nSize of: %ld", sizeof(uint32));
    return 0;