ADTF
constants.h
Go to the documentation of this file.
1 
8 #ifndef BASE_CONSTANTS_H
9 #define BASE_CONSTANTS_H
10 
11 /*
12 definitions of prefix
13 */
14 
16 #define A_UTILS_GLOBAL /* */ /* g_... */
18 #define A_UTILS_MEMBER /* */ /* m_... */
20 #define A_UTILS_LOCAL auto /* l_... */
22 #define A_UTILS_STATIC static /* s_... */
24 #define A_UTILS_EXTERN extern /* g_... */
26 #define A_UTILS_REGIST register /* r_... */
27 
28 /*
29 definitions for function paramters
30 */
31 #ifndef IN
33 #define IN /* in */
34 #endif
35 
36 #ifndef OUT
38 #define OUT /* out */
39 #endif
40 
41 #ifndef INOUT
43 #define INOUT /* in,out */
44 #endif
45 
46 #ifndef OPTIONAL
48 #define OPTIONAL /* optional */
49 #endif
50 
51 #ifndef UNUSED
53 #define UNUSED /* unused */
54 #endif
55 
56 /*
57 generic constants
58 */
60 #define tFalse false
62 #define tTrue true
63 
65 #define INVALID_SIZE 0xFFFFFFFF
67 #define INVALID_POS 0xFFFFFFFF
69 #define INVALID_HANDLE 0xFFFFFFFF
70 
71 /*
72 general bit declarations
73 */
74 
75 #define BIT0 0x0001
76 #define BIT1 0x0002
77 #define BIT2 0x0004
78 #define BIT3 0x0008
79 #define BIT4 0x0010
80 #define BIT5 0x0020
81 #define BIT6 0x0040
82 #define BIT7 0x0080
83 #define BIT8 0x0100
84 #define BIT9 0x0200
85 #define BIT10 0x0400
86 #define BIT11 0x0800
87 #define BIT12 0x1000
88 #define BIT13 0x2000
89 #define BIT14 0x4000
90 #define BIT15 0x8000
91 #define BIT16 0x00010000
92 #define BIT17 0x00020000
93 #define BIT18 0x00040000
94 #define BIT19 0x00080000
95 #define BIT20 0x00100000
96 #define BIT21 0x00200000
97 #define BIT22 0x00400000
98 #define BIT23 0x00800000
99 #define BIT24 0x01000000
100 #define BIT25 0x02000000
101 #define BIT26 0x04000000
102 #define BIT27 0x08000000
103 #define BIT28 0x10000000
104 #define BIT29 0x20000000
105 #define BIT30 0x40000000
106 #define BIT31 0x80000000
107 
108 #define fHIGHBYTE(x) ( (( x ) & 0xFF00) >> 8 )
109 #define fLOWBYTE(x) ( ( x ) & 0x00FF )
110 
111 #define fHIGHWORD(x) ( (( x ) & 0xFFFF0000) >> 16 )
112 #define fLOWWORD(x) ( ( x ) & 0x0000FFFF )
113 
115 #define PLATFORM_NOT_SUPPORTED 0x00
116 
118 #define PLATFORM_LITTLE_ENDIAN_8 0x01
119 
121 #define PLATFORM_BIG_ENDIAN_8 0x02
122 
124 #define PLATFORM_BYTEORDER __get_platform_byteorder()
125 
130 static inline unsigned char __get_platform_byteorder()
131 {
132  tUInt32 ui32Value = 0x01020304;
133  if (((unsigned char*)&ui32Value)[0] == 0x04 &&
134  ((unsigned char*)&ui32Value)[2] == 0x02 )
135  {
137  }
138  else if (((unsigned char*)&ui32Value)[0] == 0x01 &&
139  ((unsigned char*)&ui32Value)[2] == 0x03 )
140  {
141  return PLATFORM_BIG_ENDIAN_8;
142  }
143  else
144  {
145  return PLATFORM_NOT_SUPPORTED;
146  }
147 }
148 
150 #define PLATFORM_COMPILER_MSVC7_RELEASE 1300
152 #define PLATFORM_COMPILER_MSVC7_DEBUG 11300
153 
155 #define PLATFORM_COMPILER_MSVC8_RELEASE 1400
157 #define PLATFORM_COMPILER_MSVC8_DEBUG 11400
158 
160 #define PLATFORM_COMPILER_MSVC9_RELEASE 1500
162 #define PLATFORM_COMPILER_MSVC9_DEBUG 11500
163 
165 #define PLATFORM_COMPILER_MSVC10_RELEASE 1600
167 #define PLATFORM_COMPILER_MSVC10_DEBUG 11600
168 
170 #define PLATFORM_COMPILER_MSVC11_RELEASE 1700
172 #define PLATFORM_COMPILER_MSVC11_DEBUG 11700
173 
175 #define PLATFORM_COMPILER_MSVC12_RELEASE 1800
177 #define PLATFORM_COMPILER_MSVC12_DEBUG 11800
178 
180 #define PLATFORM_COMPILER_MSVC14_RELEASE 1900
182 #define PLATFORM_COMPILER_MSVC14_DEBUG 11900
183 
184 //System versions (this can be move to another file if necessary)
185 
187 #define WINDOWS_SYSTEM_MAJOR_VERSION_VISTA 6
189 #define WINDOWS_SYSTEM_MINOR_VERSION_VISTA 0
190 
192 #define WINDOWS_SYSTEM_MAJOR_VERSION_XP 5
194 #define WINDOWS_SYSTEM_MINOR_VERSION_XP 1
195 
197 #define WINDOWS_SYSTEM_MAJOR_VERSION_2000 5
199 #define WINDOWS_SYSTEM_MINOR_VERSION_2000 0
200 
210 #ifdef _MSC_VER
211  #ifdef _DEBUG
212  #define PLATFORM_COMPILER_CURRENT ((_MSC_VER / 100) * 100 + 10000)
213  #else
214  #define PLATFORM_COMPILER_CURRENT ((_MSC_VER / 100) * 100)
215  #endif
216 #else
217  #define PLATFORM_COMPILER_CURRENT 0
218 #endif
219 
220 #ifndef WIN32
222  #define _stricmp strcasecmp
224  #define _strnicmp strncasecmp
225 #endif
226 
260 #ifdef A_UTILS_NO_DEPRECATED_WARNING
261  #define A_UTILS_DEPRECATED(_func_) _func_
262  #define A_UTILS_DEPRECATED_MESSAGE(_message_)
263  #define A_UTILS_CLASS_DEPRECATED_BEGIN
264  #define A_UTILS_CLASS_DEPRECATED_END
265 #else
266  #ifndef WIN32
267  #define A_UTILS_DEPRECATED(_func_) __attribute__ ((deprecated)) _func_
268  #define A_UTILS_CLASS_DEPRECATED_BEGIN
269  #define A_UTILS_CLASS_DEPRECATED_END __attribute__ ((deprecated))
270  #else
271  #define A_UTILS_DEPRECATED(_func_) __declspec( deprecated("This is deprecated. See documentation for further information!")) _func_
272  #define A_UTILS_CLASS_DEPRECATED_BEGIN __declspec( deprecated("This is deprecated. See documentation for further information!"))
273  #define A_UTILS_CLASS_DEPRECATED_END
274  #endif
275  #define A_UTILS_DEPRECATED_MESSAGE(_depr_message_) [[deprecated(_depr_message_)]]
276 #endif
277 
278 #ifdef A_UTILS_LEGACY_CONSTANTS_MACROS
279  #include "constantslegacy.h"
280 #endif //A_UTILS_LEGACY_CONSTANTS_MACROS
281 
282 
283 #endif /* BASE_CONSTANTS_H */
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
#define PLATFORM_NOT_SUPPORTED
defines a common value for unsupportes platform
Definition: constants.h:115
static unsigned char __get_platform_byteorder()
This function retrieves the platform dependent byte order.
Definition: constants.h:130
#define PLATFORM_BIG_ENDIAN_8
defines the big endianess value, that will be retrieved by
Definition: constants.h:121
#define PLATFORM_LITTLE_ENDIAN_8
defines the little endianess value, that will be retrieved by
Definition: constants.h:118
Copyright © Audi Electronics Venture GmbH.