Debian Codegraph @

3rdparty/xspublic/xstypes/xstypesconfig.h

raw
1
2 // Copyright (c) 2003-2019 Xsens Technologies B.V. or subsidiaries worldwide.
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification,
6 // are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice,
9 // this list of conditions, and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice,
12 // this list of conditions, and the following disclaimer in the documentation
13 // and/or other materials provided with the distribution.
14 //
15 // 3. Neither the names of the copyright holders nor the names of their contributors
16 // may be used to endorse or promote products derived from this software without
17 // specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
26 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
28 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
29 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
30 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
31 //
32
33 #define XSTYPES_DLL_API
34 #define XSNOEXPORT
35 #define XSENS_NO_AUTOLIB
36 // include this file in Visual Studio using C/C++->Advanced->Force Includes (the /FI option)
37 #ifndef XSTYPES_CONFIG_H
38 #define XSTYPES_CONFIG_H
39
40 //////////////////////////////////////////////////
41 // generic preprocessor defines
42
43 //http://support.microsoft.com/kb/155196
44 #define __STR2__(x) #x
45 #define __STR1__(x) __STR2__(x)
46 #define __LOC__ __FILE__ "(" __STR1__(__LINE__)") : WARNING: "
47
48 // make sure both _WIN32 and WIN32 are defined if either of them is.
49 #if defined(_WIN32) || defined(_M_IX86)
50 # ifndef WIN32
51 # define WIN32
52 # endif
53 # define XSENS_WINDOWS
54 #endif
55
56 #ifdef WIN32
57 # ifndef _WIN32
58 # define _WIN32
59 # define XSENS_WINDOWS
60 # endif
61 #endif
62 #if !defined(_WIN32) && defined(_MSC_VER) && !defined(_WIN64)
63 # define _WIN64
64 #endif
65
66 // make things as secure as possible without modifying the code...
67 #ifndef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
68 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
69 #endif
70 #ifndef _CRT_SECURE_NO_WARNINGS
71 #define _CRT_SECURE_NO_WARNINGS
72 #endif
73
74 #ifndef __cplusplus
75 // make sure that const-correctness is enforced
76 #ifdef _MSC_VER
77 #pragma warning(error : 4090)
78 #endif
79 #define XSCCONST const
80 #define XSCPPPROTECTED
81 #else
82 #define XSCCONST
83 #define XSCPPPROTECTED protected:
84 #endif
85
86 #ifdef __GNUC__
87 # include <limits.h>
88 # if __WORDSIZE == 64
89 # define XSENS_64BIT
90 # else
91 # define XSENS_32BIT
92 # endif
93 # ifndef XSENS_PFSHARED
94 # define XSENS_PFSHARED ".so"
95 # define XSENS_PFPRE "lib"
96 # endif
97 #else
98 # ifndef XSENS_PFSHARED
99 # define XSENS_PFSHARED ".dll"
100 # define XSENS_PFPRE ""
101 # endif
102 #endif
103
104 #if defined(_WIN64) || defined(_M_X64) || defined(_M_IA64)
105 # ifndef XSENS_64BIT
106 # define XSENS_64BIT
107 # endif
108 # ifndef XSENS_WINDOWS
109 # define XSENS_WINDOWS
110 # endif
111 # ifndef _WIN64
112 # define _WIN64
113 # endif
114 # ifndef WIN64
115 # define WIN64
116 # endif
117 # ifndef XSENS_PFBITS
118 # ifdef __GNUC__
119 # define XSENS_PFBITS ""
120 # else
121 # define XSENS_PFBITS "64"
122 # endif
123 # endif
124 #else
125 # ifndef XSENS_32BIT
126 # define XSENS_32BIT
127 # endif
128 # ifndef XSENS_PFBITS
129 # ifdef __GNUC__
130 # define XSENS_PFBITS ""
131 # else
132 # define XSENS_PFBITS "32"
133 # endif
134 # endif
135 #endif
136
137 // all xsens libraries should use unicode
138 #ifndef UNICODE
139 #define UNICODE
140 #endif
141
142 // use XSENS_32BIT and XSENS_64BIT to check for 32/64 bit builds in your application
143 // on non-windows systems these should be defined in this file
144
145 /*
146 Configuration | Runtime | DebInfo | Defines
147 --------------+---------------------------------------
148 Debug | MDd | Yes | XSENS_DEBUG;_DEBUG
149 RelWithDeb | MD | Yes | XSENS_DEBUG;XSENS_RELEASE;_DEBUG
150 Release | MD | No | XSENS_RELEASE;NDEBUG
151
152 The common way to setup configuration-dependent defines:
153 #if defined(XSENS_DEBUG)
154 //// Debug or RelWithDeb build
155 #if defined(XSENS_RELEASE)
156 //// RelWithDeb build
157 #else
158 //// Debug build
159 #endif
160 #else
161 //// Release build
162 #endif
163 */
164
165 #if defined(XSENS_DEBUG)
166 //// Debug or RelWithDeb build
167 #ifndef XSENS_NO_STL
168 #define XSENS_USE_DEBUG_COUNTERS
169 #endif
170
171 #if !defined(XSENS_RELEASE)
172 //// Debug build
173 #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
174 #define QT_DEBUG 1
175 #endif
176 #define XSENS_CONFIG 0
177 #ifndef XSENS_PFCONF
178 #ifdef __GNUC__
179 #define XSENS_PFCONF ""
180 #else
181 #define XSENS_PFCONF "d"
182 #endif
183 #endif
184 #else
185 //// RelWithDeb build
186 #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
187 #define QT_NO_DEBUG 1
188 #endif
189 #define XSENS_CONFIG 1
190 #ifndef XSENS_PFCONF
191 #ifdef __GNUC__
192 #define XSENS_PFCONF ""
193 #else
194 #define XSENS_PFCONF "rd"
195 #endif
196 #endif
197 #endif
198 #else
199 //// Release build
200 #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
201 #define QT_NO_DEBUG 1
202 #endif
203 #define XSENS_CONFIG 3
204 #ifndef NDEBUG
205 #ifndef KEEP_ASSERTS
206 #define NDEBUG // make sure assertions and other debug options are compiled away by MSVC
207 #endif
208 #endif
209 #ifndef XSENS_PFCONF
210 #define XSENS_PFCONF ""
211 #endif
212 #endif
213
214 #ifndef XSENS_PFFULL
215 #define XSENS_PFFULL XSENS_PFBITS XSENS_PFCONF
216 #endif
217
218 //////////////////////////////////////////////////
219 // more generic preprocessor defines
220 // required for gnu c++ compiler versions due to difference in attribute declarations
221 #if defined(__AVR32__)
222 # define __cdecl
223 # define __stdcall
224 #elif defined(_ADI_COMPILER)
225 # define __cdecl
226 # define __stdcall
227 #elif defined(__GNUC__) && !defined(HAVE_CDECL)
228 # if !defined(__cdecl)
229 # if defined(__x86_64__)
230 # define __cdecl
231 # else
232 # define __cdecl __attribute__((cdecl))
233 # endif
234 # endif
235 # if !defined(__stdcall)
236 # if defined(__x86_64__)
237 # define __stdcall
238 # else
239 # define __stdcall __attribute__((stdcall))
240 #endif
241 # endif
242 #endif
243
244
245 //////////////////////////////////////////////////
246 // generic preprocessor defines
247
248 // use XSENS_32BIT and XSENS_64BIT to check for 32/64 bit builds in your application
249 // on non-windows systems these should be defined
250
251 #ifndef XSTYPES_DLL_API
252 # ifdef XSTYPES_DLL_EXPORT
253 # ifdef _WIN32
254 //# pragma message("XSTYPES_DLL_API export in xstypesconfig.h")
255 # define XSTYPES_DLL_API __declspec(dllexport)
256 # else
257 //# pragma message("XSTYPES_DLL_API linux export in xstypesconfig.h")
258 # define XSTYPES_DLL_API __attribute__((visibility("default")))
259 # endif
260 # else // ifdef XSTYPES_DLL_EXPORT
261 # ifdef XSTYPES_STATIC_LIB
262 //# pragma message("XSTYPES_DLL_API static in xstypesconfig.h")
263 # define XSTYPES_DLL_API
264 # else
265 # ifdef _WIN32
266 //# pragma message("XSTYPES_DLL_API import in xstypesconfig.h")
267 # define XSTYPES_DLL_API __declspec(dllimport)
268 # else
269 //# pragma message("XSTYPES_DLL_API import/static for linux in xstypesconfig.h")
270 # define XSTYPES_DLL_API
271 # endif
272 # endif
273 # endif // ifdef XSTYPES_DLL_EXPORT - else
274 #endif // ifndef XSTYPES_DLL_API
275
276 #if XSENS_CONFIG < 3 // anything except full release builds
277 //////////////////////////////////////////////////
278 // stuff for debugging
279
280 #else
281 // non-debug stuff
282 //
283 #endif
284
285 #include <assert.h>
286
287 // since this is (almost) always required and it does not conflict with pstdint, include the file here
288 //#define XSENS_SINGLE_PRECISION // enable for single precision
289 #include "xstypedefs.h"
290
291 #ifndef XSNOCOMEXPORT
292 #define XSNOCOMEXPORT
293 #endif
294
295 #define XSTRINGIFY2(s) #s
296 #define XSTRINGIFY(s) XSTRINGIFY2(s)
297
298 #ifdef XSENS_DEBUG
299 #define XSDEBUGLINE(a) a
300 #define XSNODEBUGLINE(...)
301 #else
302 #define XSDEBUGLINE(...)
303 #define XSNODEBUGLINE(a) a
304 #endif
305
306 #if defined(_MSC_VER) && !defined(__cplusplus) && !defined(inline)
307 /* MSVC doesn't know the inline keyword in C mode, but it does know __inline */
308 #define inline __inline
309 #endif
310
311 #endif