Main MRPT website > C++ reference for MRPT 1.9.9
xstypesconfig.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #define XSTYPES_DLL_API
10 #define XSNOEXPORT
11 #define XSENS_NO_AUTOLIB
12 // include this file in Visual Studio using C/C++->Advanced->Force Includes (the
13 // /FI option)
14 #ifndef XSTYPES_CONFIG_H
15 #define XSTYPES_CONFIG_H
16 
17 //////////////////////////////////////////////////
18 // generic preprocessor defines
19 
20 // http://support.microsoft.com/kb/155196
21 #define __STR2__(x) #x
22 #define __STR1__(x) __STR2__(x)
23 #define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : WARNING: "
24 
25 // make sure both _WIN32 and WIN32 are defined if either of them is.
26 #if defined(_WIN32) || defined(_M_IX86)
27 #ifndef WIN32
28 #define WIN32
29 #endif
30 #define XSENS_WINDOWS
31 #endif
32 
33 #ifdef WIN32
34 #ifndef _WIN32
35 #define _WIN32
36 #define XSENS_WINDOWS
37 #endif
38 #endif
39 #if !defined(_WIN32) && defined(_MSC_VER) && !defined(_WIN64)
40 #define _WIN64
41 #endif
42 
43 // make things as secure as possible without modifying the code...
44 #ifndef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
45 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
46 #endif
47 #ifndef _CRT_SECURE_NO_WARNINGS
48 #define _CRT_SECURE_NO_WARNINGS
49 #endif
50 
51 #ifndef __cplusplus
52 // make sure that const-correctness is enforced
53 #ifdef _MSC_VER
54 #pragma warning(error : 4090)
55 #endif
56 #define XSCCONST const
57 #define XSCPPPROTECTED
58 #else
59 #define XSCCONST
60 #define XSCPPPROTECTED protected:
61 #endif
62 
63 #ifdef __GNUC__
64 #include <limits.h>
65 #if __WORDSIZE == 64
66 #define XSENS_64BIT
67 #else
68 #define XSENS_32BIT
69 #endif
70 #endif
71 
72 #if defined(_WIN64) || defined(_M_X64) || defined(_M_IA64)
73 #ifndef XSENS_64BIT
74 #define XSENS_64BIT
75 #endif
76 #ifndef XSENS_WINDOWS
77 #define XSENS_WINDOWS
78 #endif
79 #ifndef _WIN64
80 #define _WIN64
81 #endif
82 #ifndef WIN64
83 #define WIN64
84 #endif
85 #else
86 #ifndef XSENS_32BIT
87 #define XSENS_32BIT
88 #endif
89 #endif
90 
91 // all xsens libraries should use unicode
92 #ifndef UNICODE
93 #define UNICODE
94 #endif
95 
96 // use XSENS_32BIT and XSENS_64BIT to check for 32/64 bit builds in your
97 // application
98 // on non-windows systems these should be defined in this file
99 
100 /*
101 Configuration | Runtime | DebInfo | Defines
102 --------------+---------------------------------------
103 Debug | MDd | Yes | XSENS_DEBUG;_DEBUG
104 RelWithDeb | MD | Yes | XSENS_DEBUG;XSENS_RELEASE;NDEBUG
105 Release | MD | No | XSENS_RELEASE;NDEBUG
106 
107 The common way to setup configuration-dependent defines:
108 #if defined(XSENS_DEBUG)
109  //// Debug or RelWithDeb build
110  #if defined(XSENS_RELEASE)
111  //// RelWithDeb build
112  #else
113  //// Debug build
114  #endif
115 #else
116  //// Release build
117 #endif
118 */
119 
120 #if defined(XSENS_DEBUG)
121 //// Debug or RelWithDeb build
122 
123 #if !defined(XSENS_RELEASE)
124 //// Debug build
125 #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
126 #define QT_DEBUG 1
127 #endif
128 #define XSENS_CONFIG 0
129 #else
130 //// RelWithDeb build
131 #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
132 #define QT_NO_DEBUG 1
133 #endif
134 #define XSENS_CONFIG 1
135 #endif
136 #else
137 //// Release build
138 #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
139 #define QT_NO_DEBUG 1
140 #endif
141 #define XSENS_CONFIG 3
142 #endif
143 
144 //////////////////////////////////////////////////
145 // more generic preprocessor defines
146 // required for gnu c++ compiler versions due to difference in attribute
147 // declarations
148 #if defined(__AVR32__)
149 #define __cdecl
150 #define __stdcall
151 #elif defined(_ADI_COMPILER)
152 #define __cdecl
153 #define __stdcall
154 #elif defined(__GNUC__) && !defined(HAVE_CDECL)
155 #if !defined(__cdecl)
156 #if defined(__x86_64__)
157 #define __cdecl
158 #else
159 #define __cdecl __attribute__((cdecl))
160 #endif
161 #endif
162 #if !defined(__stdcall)
163 #if defined(__x86_64__)
164 #define __stdcall
165 #else
166 #define __stdcall __attribute__((stdcall))
167 #endif
168 #endif
169 #endif
170 
171 //////////////////////////////////////////////////
172 // generic preprocessor defines
173 
174 // use XSENS_32BIT and XSENS_64BIT to check for 32/64 bit builds in your
175 // application
176 // on non-windows systems these should be defined
177 
178 #ifndef XSTYPES_DLL_API
179 #ifdef XSTYPES_DLL_EXPORT
180 #ifdef _WIN32
181 //# pragma message("XSTYPES_DLL_API export in xstypesconfig.h")
182 #define XSTYPES_DLL_API __declspec(dllexport)
183 #else
184 //# pragma message("XSTYPES_DLL_API linux export in xstypesconfig.h")
185 #define XSTYPES_DLL_API __attribute__((visibility("default")))
186 #endif
187 #else // ifdef XSTYPES_DLL_EXPORT
188 #ifdef XSTYPES_STATIC_LIB
189 //# pragma message("XSTYPES_DLL_API static in xstypesconfig.h")
190 #define XSTYPES_DLL_API
191 #else
192 #ifdef _WIN32
193 //# pragma message("XSTYPES_DLL_API import in xstypesconfig.h")
194 #define XSTYPES_DLL_API __declspec(dllimport)
195 #else
196 //# pragma message("XSTYPES_DLL_API import/static for linux in
197 // xstypesconfig.h")
198 #define XSTYPES_DLL_API
199 #endif
200 #endif
201 #endif // ifdef XSTYPES_DLL_EXPORT - else
202 #endif // ifndef XSTYPES_DLL_API
203 
204 #if XSENS_CONFIG < 3 // anything except full release builds
205 //////////////////////////////////////////////////
206 // stuff for debugging
207 
208 #else
209 // non-debug stuff
210 //
211 #endif
212 
213 #include <assert.h>
214 
215 // since this is (almost) always required and it does not conflict with pstdint,
216 // include the file here
217 #include "xstypedefs.h"
218 
219 #ifndef XSNOCOMEXPORT
220 #define XSNOCOMEXPORT
221 #endif
222 
223 #endif // file guard
xstypedefs.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST