add size_t typedef

This commit is contained in:
Baptiste Wicht 2013-11-22 15:58:55 +01:00
parent 32b715723b
commit 79ba19fa8a

View File

@ -15,11 +15,13 @@ typedef unsigned int uint32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int uint64_t __attribute__ ((__mode__ (__DI__)));
typedef uint64_t uintptr_t;
typedef uint64_t size_t;
static_assert(sizeof(uint8_t) == 1, "uint32_t must be 1 byte long");
static_assert(sizeof(uint16_t) == 2, "uint32_t must be 2 bytes long");
static_assert(sizeof(uint32_t) == 4, "uint32_t must be 4 bytes long");
static_assert(sizeof(uint64_t) == 8, "uint64_t must be 8 bytes long");
static_assert(sizeof(size_t) == 8, "size_t must be 8 bytes long");
static_assert(sizeof(uintptr_t) == sizeof(uint64_t*), "uintptr_t must have the same size as a pointer");
#endif