2016-01-24 06:19:34 -05:00
|
|
|
#include "STDInclude.hpp"
|
|
|
|
|
|
|
|
// Do necessary assertions here
|
2016-01-24 06:56:38 -05:00
|
|
|
// Some compilers treat them differently which causes a size mismatch
|
|
|
|
|
|
|
|
// WinAPI types
|
2016-01-24 06:19:34 -05:00
|
|
|
Assert_Size(DWORD, 4);
|
|
|
|
Assert_Size(WORD, 2);
|
|
|
|
Assert_Size(BYTE, 1);
|
|
|
|
|
2016-01-24 06:56:38 -05:00
|
|
|
// 64 bit integers
|
|
|
|
Assert_Size(__int64, 8);
|
|
|
|
Assert_Size(unsigned __int64, 8);
|
2016-01-24 06:19:34 -05:00
|
|
|
Assert_Size(long long, 8);
|
2016-01-24 06:56:38 -05:00
|
|
|
Assert_Size(unsigned long long, 8);
|
|
|
|
Assert_Size(int64_t, 8);
|
|
|
|
Assert_Size(uint64_t, 8);
|
|
|
|
|
|
|
|
// 32 bit integers
|
|
|
|
Assert_Size(__int32, 4);
|
|
|
|
Assert_Size(unsigned __int32, 4);
|
2016-01-24 06:19:34 -05:00
|
|
|
Assert_Size(int, 4);
|
2016-01-24 06:56:38 -05:00
|
|
|
Assert_Size(unsigned int, 4);
|
|
|
|
Assert_Size(int32_t, 4);
|
|
|
|
Assert_Size(uint32_t, 4);
|
|
|
|
|
|
|
|
// 16 bit integers
|
|
|
|
Assert_Size(__int16, 2);
|
|
|
|
Assert_Size(unsigned __int16, 2);
|
2016-01-24 06:19:34 -05:00
|
|
|
Assert_Size(short, 2);
|
2016-01-24 06:56:38 -05:00
|
|
|
Assert_Size(unsigned short, 2);
|
|
|
|
Assert_Size(int16_t, 2);
|
|
|
|
Assert_Size(uint16_t, 2);
|
|
|
|
|
|
|
|
// 8 bit integers
|
|
|
|
Assert_Size(__int8, 1);
|
|
|
|
Assert_Size(unsigned __int8, 1);
|
2016-01-24 06:34:29 -05:00
|
|
|
Assert_Size(char, 1);
|
2016-01-24 06:56:38 -05:00
|
|
|
Assert_Size(unsigned char, 1);
|
|
|
|
Assert_Size(int8_t, 1);
|
|
|
|
Assert_Size(uint8_t, 1);
|
|
|
|
|
|
|
|
// Ensure pointers are 4 bytes in size (32-bit)
|
|
|
|
static_assert(sizeof(intptr_t) == 4 && sizeof(void*) == 4 && sizeof(size_t) == 4, "This doesn't seem to be a 32-bit environment!");
|