3 This file defines typedefs for 8, 16, and 32 bit integers. They are:
4 cit_int8_t default 8-bit int
5 cit_int16_t default 16-bit int
6 cit_int32_t default 32-bit int
7 cit_int64_t default 64-bit int (not implemented yet)
8 cit_sint8_t signed 8-bit int
9 cit_sint16_t signed 16-bit int
10 cit_sint32_t signed 32-bit int
11 cit_sint64_t signed 64-bit int (not implemented yet)
12 cit_uint8_t unsigned 8-bit int
13 cit_uint16_t unsigned 16-bit int
14 cit_uint32_t unsigned 32-bit int
15 cit_uint64_t unsigned 64-bit int (not implemented yet)
17 The sizes are determined during the configure process; see the
18 AC_CHECK_SIZEOF macros in configure.in. In no way do we assume that any
19 given datatype is any particular width, e.g. we don't assume short is two
20 bytes; we check for it specifically.
22 This might seem excessively paranoid, but I've seen some WEIRD systems
23 and some bizarre compilers (Domain/OS for instance) in my time.
26 #ifndef _CITADEL_UX_TYPESIZE_H
27 #define _CITADEL_UX_TYPESIZE_H
29 /* Include sysdep.h if not already included */
34 /* 8-bit - If this fails, your compiler is broken */
36 typedef char cit_int8_t;
37 typedef signed char cit_sint8_t;
38 typedef unsigned char cit_uint8_t;
40 # error Unable to find an 8-bit integer datatype
43 /* 16-bit - If this fails, your compiler is broken */
45 typedef short cit_int16_t;
46 typedef signed short cit_sint16_t;
47 typedef unsigned short cit_uint16_t;
49 typedef int cit_int16_t;
50 typedef signed int cit_sint16_t;
51 typedef unsigned int cit_uint16_t;
53 # error Unable to find a 16-bit integer datatype
56 /* 32-bit - If this fails, your compiler is broken */
58 typedef int cit_int32_t;
59 typedef signed int cit_sint32_t;
60 typedef unsigned int cit_uint32_t;
61 #elif SIZEOF_LONG == 4
62 typedef long cit_int32_t;
63 typedef signed long cit_sint32_t;
64 typedef unsigned long cit_uint32_t;
66 # error Unable to find a 32-bit integer datatype
69 #endif /* _CITADEL_UX_TYPESIZE_H */