File: bittypes.h

package info (click to toggle)
xcopilot 1%3A0.6.6
  • links: PTS
  • area: contrib
  • in suites: potato, slink
  • size: 3,252 kB
  • ctags: 3,406
  • sloc: ansic: 37,932; cpp: 1,918; sh: 329; makefile: 68
file content (56 lines) | stat: -rw-r--r-- 1,093 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef BITTYPES_H_INCLUDED
#define BITTYPES_H_INCLUDED

#include <config.h>

#if SIZEOF_CHAR == 1
typedef signed char int8;
#else
#error sizeof(char) is not equal to 8
#endif

#if SIZEOF_UNSIGNED_CHAR == 1
typedef unsigned char uint8;
#else
#error sizeof(unsigned char) is not equal to 8
#endif

#if SIZEOF_SHORT == 2
typedef short int16;
#elif SIZEOF_INT == 2
typedef int int16;
#else
#error Unable to find type for int16
#endif

#if SIZEOF_UNSIGNED_SHORT == 2
typedef unsigned short uint16;
#elif SIZEOF_UNSIGNED_INT == 2
typedef unsigned int uint16;
#elif SIZEOF_UNSIGNED_LONG == 2
typedef unsigned long uint16;
#else
#error Unable to find type for uint16
#endif

#if SIZEOF_INT == 4
typedef int int32;
#elif SIZEOF_LONG == 4
typedef long int32;
#elif SIZEOF_SHORT == 4
typedef short int32;
#else
#error Unable to find type for int32
#endif

#if SIZEOF_UNSIGNED_INT == 4
typedef unsigned int uint32;
#elif SIZEOF_UNSIGNED_LONG == 4
typedef unsigned long uint32;
#elif SIZEOF_UNSIGNED_SHORT == 4
typedef unsigned short uint32;
#else
#error Unable to find type for uint32!!!!
#endif

#endif