Main MRPT website > C++ reference for MRPT 1.5.7
xcommunicationconfig.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-2017, 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 XSENS_NO_AUTOLIB
10 // include this file in Visual Studio using C/C++->Advanced->Force Includes (the /FI option)
11 #ifndef XCOMMUNICATION_CONFIG_H
12 #define XCOMMUNICATION_CONFIG_H
13 
14 // define to build with Journaller
15 #ifndef HAVE_JOURNALLER
16 //#define HAVE_JOURNALLER
17 #endif
18 
19 //////////////////////////////////////////////////
20 // generic preprocessor defines
21 
22 // make sure both _WIN32 and WIN32 are defined if either of them is.
23 #if defined(_WIN32) || defined(_M_IX86)
24 # ifndef WIN32
25 # define WIN32
26 # endif
27 # define XSENS_WINDOWS
28 #endif
29 
30 #ifdef WIN32
31 # ifndef _WIN32
32 # define _WIN32
33 # define XSENS_WINDOWS
34 # endif
35 #endif
36 
37 #ifdef _WIN32
38 # define USE_WINUSB
39 #else
40 # define XSENS_NO_PORT_NUMBERS
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 #ifdef __GNUC__
52 #include <limits.h>
53 #if __WORDSIZE == 64
54 # define XSENS_64BIT
55 #else
56 # define XSENS_32BIT
57 #endif
58 #endif
59 
60 #if defined(_WIN64) || defined(_M_X64) || defined(_M_IA64)
61 # ifndef XSENS_64BIT
62 # define XSENS_64BIT
63 # endif
64 # ifndef XSENS_WINDOWS
65 # define XSENS_WINDOWS
66 # endif
67 # ifndef WIN64
68 # define WIN64
69 # endif
70 #else
71 # ifndef XSENS_32BIT
72 # define XSENS_32BIT
73 # endif
74 #endif
75 
76 // all xsens libraries should use unicode
77 #ifndef UNICODE
78 #define UNICODE
79 #endif
80 
81 // use XSENS_32BIT and XSENS_64BIT to check for 32/64 bit builds in your application
82 // on non-windows systems these should be defined in this file
83 
84 /*
85 Configuration | Runtime | DebInfo | Defines
86 --------------+---------------------------------------
87 Debug | MDd | Yes | XSENS_DEBUG;_DEBUG
88 RelWithDeb | MD | Yes | XSENS_DEBUG;XSENS_RELEASE;NDEBUG
89 Release | MD | No | XSENS_RELEASE;NDEBUG
90 
91 The common way to setup configuration-dependent defines:
92 #if defined(XSENS_DEBUG)
93  //// Debug or RelWithDeb build
94  #if defined(XSENS_RELEASE)
95  //// RelWithDeb build
96  #else
97  //// Debug build
98  #endif
99 #else
100  //// Release build
101 #endif
102 */
103 
104 #if defined(XSENS_DEBUG)
105  //// Debug or RelWithDeb build
106  #define LOG_RX_TX // Lowest level byte receive and send (binary log)
107  //#define LOG_RX_TX_FLUSH // Flush after each log operation (can cause hickups in timing, 300ms is not unheard of)
108 
109  #if defined(XSENS_RELEASE)
110  //// RelWithDeb build
111  #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
112  #define QT_NO_DEBUG 1
113  #endif
114  #ifdef HAVE_JOURNALLER
115  #define JLLOGLEVEL JLL_DEBUG
116  #define RUN_LL JLL_DEBUG // JLL_ALERT
117  #define DEBUG_LL JLL_ERROR
118  #endif
119  #else
120  //// Debug build
121  #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
122  #define QT_DEBUG 1
123  #endif
124  #ifdef HAVE_JOURNALLER
125  #define JLLOGLEVEL JLL_TRACE
126  #define RUN_LL JLL_DEBUG
127  #define DEBUG_LL JLL_ERROR
128  #endif
129  #endif
130 #else
131  //// Release build
132  #if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
133  #define QT_NO_DEBUG 1
134  #endif
135  #ifdef HAVE_JOURNALLER
136  #define JLLOGLEVEL JLL_ALERT
137  #define RUN_LL JLL_ERROR
138  #define DEBUG_LL JLL_FATAL
139  #endif
140 #endif
141 
142 //////////////////////////////////////////////////
143 // more generic preprocessor defines
144 //! Add this macro to the start of a class definition to prevent automatic creation of copy functions
145 #define XSENS_DISABLE_COPY(className) \
146 private: \
147  className(const className &); \
148  className &operator = (const className &);
149 
150 #ifdef __cplusplus
151 #ifdef HAVE_JOURNALLER
152 #include <journaller/journaller.h>
153 #else
154 class Journaller;
155 #endif
156 extern Journaller* gJournal;
157 #endif
158 
159 #if defined(HAVE_JOURNALLER) && (defined(XSENS_DEBUG) || defined(XS_LOG_ALWAYS))
160 # define XSEXITLOGC(j) JournalValueJanitor<int> _xsExitLogC(j, m_lastResult, std::string(__FUNCTION__) + " exit, lastResult = ")
161 # define XSEXITLOGD(j) XSEXITLOGC(j) //JournalValueJanitor<int> _xsExitLogD(j, d->m_lastResult, std::string(__FUNCTION__) + " exit, lastResult = ")
162 # define XSEXITLOGN(j) JournalValueJanitor<std::string> _xsExitLogN(j, std::string(), std::string(__FUNCTION__) + " exit")
163 # ifndef DIDLOG
164 # define DIDLOG(d) JLHEXLOG(d)
165 # endif
166 #else
167 # define XSEXITLOGC(j) ((void) 0)
168 # define XSEXITLOGD(j) ((void) 0)
169 # define XSEXITLOGN(j) ((void) 0)
170 # ifndef DIDLOG
171 # define DIDLOG(d) ""
172 # endif
173 
174 #if !defined(HAVE_JOURNALLER) && !defined(JLDEBUG)
175 #define JLTRACE(...) ((void)0)
176 #define JLTRACE_NODEC(...) ((void)0)
177 #define JLDEBUG(...) ((void)0)
178 #define JLDEBUG_NODEC(...) ((void)0)
179 #define JLALERT(...) ((void)0)
180 #define JLALERT_NODEC(...) ((void)0)
181 #define JLERROR(...) ((void)0)
182 #define JLERROR_NODEC(...) ((void)0)
183 #define JLFATAL(...) ((void)0)
184 #define JLFATAL_NODEC(...) ((void)0)
185 #endif
186 
187 #endif
188 
189 #endif // file guard



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019