-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatatyp.h
54 lines (50 loc) · 1.32 KB
/
datatyp.h
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
// datatyp.h
// Defines data types that are independent of the compiler specific
// char/short/int/long types.
#ifndef __DATATYP_H
#define __DATATYP_H
#include <limits.h>
#if (UCHAR_MAX == 255)
typedef unsigned char UINT8;
typedef signed char SINT8;
#else
#error No 8-bit integer type found
#endif
#if (UCHAR_MAX == 65535)
typedef unsigned char UINT16;
typedef signed char SINT16;
#else
#if (USHRT_MAX == 65535)
typedef unsigned short UINT16;
typedef signed short SINT16;
#else
#if (UINT_MAX == 65535)
typedef unsigned int UINT16;
typedef signed int SINT16;
#else
#error No 16-bit integer type found
#endif
#endif
#endif
#if (UCHAR_MAX == 4294967295U)
typedef unsigned char UINT32;
typedef signed char SINT32;
#else
#if (USHRT_MAX == 4294967295U)
typedef unsigned short UINT32;
typedef signed short SINT32;
#else
#if (UINT_MAX == 4294967295U)
typedef unsigned int UINT32;
typedef signed int SINT32;
#else
#if (ULONG_MAX == 4294967295)
typedef unsigned long UINT32;
typedef signed long SINT32;
#else
#error No 32-bit integer type found
#endif
#endif
#endif
#endif
#endif