ADTF
builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/types.h
Go to the documentation of this file.
1 
8 #ifndef BASE_TYPES_H
9 #define BASE_TYPES_H
10 
11 #include <cstddef>
12 #include <limits>
13 #include <signal.h>
14 
16 
17 #ifdef WIN32
18  #if (_MSC_VER > 1200)
19  #define COMPILER_SUPPORTS_STANDARDTYPES
20  #endif
21 #else
22  #define COMPILER_SUPPORTS_STANDARDTYPES
23 #endif
24 
25 #ifdef COMPILER_SUPPORTS_STANDARDTYPES
26  // use stdint.h types on all platforms but windows
27  #include <stdint.h>
28  typedef int8_t tInt8; /* i8 */
29  typedef uint8_t tUInt8; /* ui8 */
30  typedef int16_t tInt16; /* i16 */
31  typedef uint16_t tUInt16; /* ui16 */
32  typedef int32_t tInt32; /* i32 */
33  typedef uint32_t tUInt32; /* ui32 */
34  typedef int64_t tInt64; /* i64 */
35  typedef uint64_t tUInt64; /* ui64 */
36 #else
37  #include "a_utils_portable_types.h"
38 #endif
39 
40 
44 typedef void tVoid; /* v */
49 typedef bool tBool; /* b */
54 typedef char tChar; /* c */
59 typedef signed short int tWChar; /* wc */
60 
63 typedef float tFloat32; /* f32 */
66 typedef double tFloat64; /* f64 */
67 
70 typedef int tInt; /* n */
73 typedef unsigned int tUInt; /* n */
75 typedef double tFloat; /* f */
76 
79 typedef tInt64 tFileSize; /* sz */
82 typedef tInt64 tFilePos; /* pos */
84 typedef tVoid* tHandle; /* h */
88 typedef tInt64 tTimeStamp; /* n */
91 typedef size_t tSize; /* sz */
93 constexpr tSize g_npos = (std::numeric_limits<size_t>::max)(); // parenthesis are to suppress macro expansion (windows.h defines a max() as macro)
94 
95 
100 #ifndef WIN32
101  typedef char TCHAR;
102 #endif // WIN32
103 
110 #ifdef WIN32
111  #ifdef WIN64
112  typedef tUInt64 tMemoryAddress;
113  #else
114  typedef tUInt32 tMemoryAddress;
115  #endif
116 #else
117  #if (__WORDSIZE == 64)
118  typedef tUInt64 tMemoryAddress;
119  #else
120  #if (__WORDSIZE == 32)
121  typedef tUInt32 tMemoryAddress;
122  #else
123  #if (__WORDSIZE == 16)
124  typedef tUInt16 tMemoryAddress;
125  #else
127  #endif
128  #endif
129  #endif
130 #endif
131 
179 #endif /* BASE_TYPES_H */
Copyright © Audi Electronics Venture GmbH.
uint8_t tUInt8
type definition for unsigned integer values (8bit) (platform and compiler independent type).
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
tInt64 tFileSize
type definition for a file or stream size value (platform and compiler independent type).
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
int16_t tInt16
type definition for signed integer values (16bit) (platform and compiler independent type).
int32_t tInt32
type definition for signed integer values (32bit) (platform and compiler independent type).
tInt64 tFilePos
type definition for a file or stream position value (platform and compiler independent type).
unsigned int tUInt
type definition for unsigned integer value (platform and compiler dependent type).
double tFloat
type definition for double value (platform and compiler dependent type).
float tFloat32
type definition for Float32 (32bit float values) (platform and compiler independent type).
void tVoid
The tVoid is always the definition for the void (non-type).
uint16_t tUInt16
type definition for unsigned integer values (16bit) (platform and compiler independent type).
tVoid * tHandle
type definition for a handle value (platform and compiler dependent type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
double tFloat64
type definition for Float64 (64bit double values) (platform and compiler independent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
size_t tSize
type definition for a array size values, map size values etc.
tUInt tMemoryAddress
The tMemoryAddress always defines a type for the platforms memory address pointer (tVoid*) (32 / 64 b...
int8_t tInt8
type definition for signed integer values (8bit) (platform and compiler independent type).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
signed short int tWChar
The tWChar defines the type for platform wide character set (platform and compiler dependent type).