File: datatypes.h

package info (click to toggle)
turqstat 1.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 212 kB
  • ctags: 463
  • sloc: cpp: 2,637; makefile: 68
file content (47 lines) | stat: -rw-r--r-- 1,191 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
#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