citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

typesize.h
Go to the documentation of this file.
1
2/*
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)
16
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.
21
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.
24*/
25
26#ifndef _CITADEL_UX_TYPESIZE_H
27#define _CITADEL_UX_TYPESIZE_H
28
29/* Include sysdep.h if not already included */
30#ifndef CTDLDIR
31# include "sysdep.h"
32#endif
33
34/* 8-bit - If this fails, your compiler is broken */
35#if SIZEOF_CHAR == 1
36typedef char cit_int8_t;
37typedef signed char cit_sint8_t;
38typedef unsigned char cit_uint8_t;
39#else
40# error Unable to find an 8-bit integer datatype
41#endif
42
43/* 16-bit - If this fails, your compiler is broken */
44#if SIZEOF_SHORT == 2
45typedef short cit_int16_t;
46typedef signed short cit_sint16_t;
47typedef unsigned short cit_uint16_t;
48#elif SIZEOF_INT == 2
49typedef int cit_int16_t;
50typedef signed int cit_sint16_t;
51typedef unsigned int cit_uint16_t;
52#else
53# error Unable to find a 16-bit integer datatype
54#endif
55
56/* 32-bit - If this fails, your compiler is broken */
57#if SIZEOF_INT == 4
58typedef int cit_int32_t;
59typedef signed int cit_sint32_t;
60typedef unsigned int cit_uint32_t;
61#elif SIZEOF_LONG == 4
62typedef long cit_int32_t;
63typedef signed long cit_sint32_t;
64typedef unsigned long cit_uint32_t;
65#else
66# error Unable to find a 32-bit integer datatype
67#endif
68
69#endif /* _CITADEL_UX_TYPESIZE_H */
signed int cit_sint32_t
Definition: typesize.h:59
unsigned int cit_uint32_t
Definition: typesize.h:60
short cit_int16_t
Definition: typesize.h:45
signed char cit_sint8_t
Definition: typesize.h:37
signed short cit_sint16_t
Definition: typesize.h:46
char cit_int8_t
Definition: typesize.h:36
int cit_int32_t
Definition: typesize.h:58
unsigned char cit_uint8_t
Definition: typesize.h:38
unsigned short cit_uint16_t
Definition: typesize.h:47