1 // This file defines typedefs for 8, 16, and 32 bit integers. They are:
2 // cit_int8_t default 8-bit int
3 // cit_int16_t default 16-bit int
4 // cit_int32_t default 32-bit int
5 // cit_int64_t default 64-bit int (not implemented yet)
6 // cit_sint8_t signed 8-bit int
7 // cit_sint16_t signed 16-bit int
8 // cit_sint32_t signed 32-bit int
9 // cit_sint64_t signed 64-bit int (not implemented yet)
10 // cit_uint8_t unsigned 8-bit int
11 // cit_uint16_t unsigned 16-bit int
12 // cit_uint32_t unsigned 32-bit int
13 // cit_uint64_t unsigned 64-bit int (not implemented yet)
15 #ifndef CITADEL_TYPESIZE_H
16 #define CITADEL_TYPESIZE_H
18 // Include sysdep.h if not already included
23 // 8-bit - If this fails, your compiler is broken
25 typedef char cit_int8_t;
26 typedef signed char cit_sint8_t;
27 typedef unsigned char cit_uint8_t;
29 # error Unable to find an 8-bit integer datatype
32 // 16-bit - If this fails, your compiler is broken
34 typedef short cit_int16_t;
35 typedef signed short cit_sint16_t;
36 typedef unsigned short cit_uint16_t;
38 typedef int cit_int16_t;
39 typedef signed int cit_sint16_t;
40 typedef unsigned int cit_uint16_t;
42 # error Unable to find a 16-bit integer datatype
45 // 32-bit - If this fails, your compiler is broken
47 typedef int cit_int32_t;
48 typedef signed int cit_sint32_t;
49 typedef unsigned int cit_uint32_t;
50 #elif SIZEOF_LONG == 4
51 typedef long cit_int32_t;
52 typedef signed long cit_sint32_t;
53 typedef unsigned long cit_uint32_t;
55 # error Unable to find a 32-bit integer datatype
58 #endif // CITADEL_TYPESIZE_H