ionTypes.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "ionConfig.h"
12 
13 #include <climits>
14 #include <vector>
15 #include <set>
16 #include <map>
17 #include <unordered_map>
18 #include <list>
19 #include <deque>
20 #include <string>
21 #include <type_traits>
22 #include <initializer_list>
23 
24 
25 // 8 bits integer types
26 #if UCHAR_MAX == 0xFF
27  typedef signed char Int8;
28  typedef unsigned char Uint8;
29 #else
30  #error No 8 bits integer type for this platform
31 #endif
32 
33 // 16 bits integer types
34 #if USHRT_MAX == 0xFFFF
35  typedef signed short Int16;
36  typedef unsigned short Uint16;
37 #elif UINT_MAX == 0xFFFF
38  typedef signed int Int16;
39  typedef unsigned int Uint16;
40 #elif ULONG_MAX == 0xFFFF
41  typedef signed long Int16;
42  typedef unsigned long Uint16;
43 #else
44  #error No 16 bits integer type for this platform
45 #endif
46 
47 // 32 bits integer types
48 #if USHRT_MAX == 0xFFFFFFFF
49  typedef signed short Int32;
50  typedef unsigned short Uint32;
51 #elif UINT_MAX == 0xFFFFFFFF
52  typedef signed int Int32;
53  typedef unsigned int Uint32;
54 #elif ULONG_MAX == 0xFFFFFFFF
55  typedef signed long Int32;
56  typedef unsigned long Uint32;
57 #else
58  #error No 32 bits integer type for this platform
59 #endif
60 
61 // 64 bits integer types
62 #if USHRT_MAX == 0xFFFFFFFFFFFFFFFF
63  typedef signed short Int64;
64  typedef unsigned short Uint64;
65  #define _ION_64BIT_INTEGERS_DEFINED
66 #elif UINT_MAX == 0xFFFFFFFFFFFFFFFF
67  typedef signed int Int64;
68  typedef unsigned int Uint64;
69  #define _ION_64BIT_INTEGERS_DEFINED
70 #elif ULONG_MAX == 0xFFFFFFFFFFFFFFFF
71  typedef signed long Int64;
72  typedef unsigned long Uint64;
73  #define _ION_64BIT_INTEGERS_DEFINED
74 #elif ULLONG_MAX == 0xFFFFFFFFFFFFFFFF
75  typedef signed long long Int64;
76  typedef unsigned long long Uint64;
77  #define _ION_64BIT_INTEGERS_DEFINED
78 #endif
79 
80 // Bit-specified types
81 typedef Int8 s8;
82 typedef Uint8 u8;
83 typedef char c8;
84 
85 typedef Int16 s16;
86 typedef Uint16 u16;
87 
88 typedef Int32 s32;
89 typedef Uint32 u32;
90 
91 typedef Int64 s64;
92 typedef Uint64 u64;
93 
94 typedef float f32;
95 typedef double f64;
96 
97 // Standard types
98 typedef unsigned short ushort;
99 typedef unsigned int uint;
100 typedef unsigned long ulong;
101 typedef unsigned long long ulonglong;
102 typedef unsigned char byte;
103 
104 // STL imports
105 using std::string;
106 using std::vector;
107 using std::list;
108 using std::set;
109 using std::map;
110 using std::multimap;
111 using std::unordered_map;
112 using std::pair;
113 using std::make_pair;
unsigned char byte
Definition: ionTypes.h:102
Int8 s8
Definition: ionTypes.h:81
unsigned short ushort
Definition: ionTypes.h:98
Uint8 u8
Definition: ionTypes.h:82
unsigned long long ulonglong
Definition: ionTypes.h:101
Uint64 u64
Definition: ionTypes.h:92
Int16 s16
Definition: ionTypes.h:85
unsigned int uint
Definition: ionTypes.h:99
Uint16 u16
Definition: ionTypes.h:86
Int32 s32
Definition: ionTypes.h:88
float f32
Definition: ionTypes.h:94
Uint32 u32
Definition: ionTypes.h:89
lib set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) include_directories("$
Definition: CMakeLists.txt:7
Int64 s64
Definition: ionTypes.h:91
char c8
Definition: ionTypes.h:83
double f64
Definition: ionTypes.h:95
unsigned long ulong
Definition: ionTypes.h:100