]> code.citadel.org Git - citadel.git/blob - citadel/server/typesize.h
Changed how Message-ID RFC2822 field is generated
[citadel.git] / citadel / server / typesize.h
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)
14
15 #ifndef CITADEL_TYPESIZE_H
16 #define CITADEL_TYPESIZE_H
17
18 // Include sysdep.h if not already included
19 #ifndef CTDLDIR
20 # include "sysdep.h"
21 #endif
22
23 // 8-bit - If this fails, your compiler is broken
24 #if SIZEOF_CHAR == 1
25 typedef char cit_int8_t;
26 typedef signed char cit_sint8_t;
27 typedef unsigned char cit_uint8_t;
28 #else
29 # error Unable to find an 8-bit integer datatype
30 #endif
31
32 // 16-bit - If this fails, your compiler is broken
33 #if SIZEOF_SHORT == 2
34 typedef short cit_int16_t;
35 typedef signed short cit_sint16_t;
36 typedef unsigned short cit_uint16_t;
37 #elif SIZEOF_INT == 2
38 typedef int cit_int16_t;
39 typedef signed int cit_sint16_t;
40 typedef unsigned int cit_uint16_t;
41 #else
42 # error Unable to find a 16-bit integer datatype
43 #endif
44
45 // 32-bit - If this fails, your compiler is broken
46 #if SIZEOF_INT == 4
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;
54 #else
55 # error Unable to find a 32-bit integer datatype
56 #endif
57
58 #endif // CITADEL_TYPESIZE_H