forked from CppMicroServices/CppMicroServices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usConfig.h.in
228 lines (185 loc) · 7.16 KB
/
usConfig.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*
USCONFIG.h
this file is generated. Do not change!
*/
#ifndef USCONFIG_H
#define USCONFIG_H
#cmakedefine US_BUILD_SHARED_LIBS
#cmakedefine CppMicroServices_EXPORTS
#cmakedefine US_ENABLE_AUTOLOADING_SUPPORT
#cmakedefine US_ENABLE_THREADING_SUPPORT
#cmakedefine US_ENABLE_RESOURCE_COMPRESSION
#cmakedefine US_GCC_RTTI_WORKAROUND_NEEDED
//-------------------------------------------------------------------
// Header Availability
//-------------------------------------------------------------------
#cmakedefine US_HAVE_STDINT_H
#cmakedefine US_HAVE_TR1_UNORDERED_MAP_H
#cmakedefine US_HAVE_TR1_UNORDERED_SET_H
#cmakedefine US_HAVE_TR1_FUNCTIONAL_H
#cmakedefine US_HAVE_UNORDERED_MAP_H
#cmakedefine US_HAVE_UNORDERED_SET_H
#cmakedefine US_HAVE_FUNCTIONAL_H
#cmakedefine US_HAVE_TR1_UNORDERED_MAP
#cmakedefine US_HAVE_TR1_UNORDERED_SET
#cmakedefine US_HAVE_TR1_FUNCTION
#cmakedefine US_HAVE_STD_UNORDERED_MAP
#cmakedefine US_HAVE_STD_UNORDERED_SET
#cmakedefine US_HAVE_STD_FUNCTION
#cmakedefine US_HAVE_TR1_HASH
#cmakedefine US_HAVE_TR1_HASH_STRUCT
#cmakedefine US_HAVE_TR1_HASH_CLASS
#cmakedefine US_HAVE_STD_HASH
#cmakedefine US_HAVE_STD_HASH_STRUCT
#cmakedefine US_HAVE_STD_HASH_CLASS
///-------------------------------------------------------------------
// Version information
//-------------------------------------------------------------------
#define CppMicroServices_MAJOR_VERSION @CppMicroServices_MAJOR_VERSION@
#define CppMicroServices_MINOR_VERSION @CppMicroServices_MINOR_VERSION@
#define CppMicroServices_PATCH_VERSION @CppMicroServices_PATCH_VERSION@
#define CppMicroServices_VERSION @CppMicroServices_VERSION@
#define CppMicroServices_VERSION_STR "@CppMicroServices_VERSION@"
///-------------------------------------------------------------------
// Macros used by the unit tests
//-------------------------------------------------------------------
#define CppMicroServices_SOURCE_DIR "@CppMicroServices_SOURCE_DIR@"
///-------------------------------------------------------------------
// Macros for import/export declarations
//-------------------------------------------------------------------
#if defined(WIN32)
#define US_ABI_EXPORT __declspec(dllexport)
#define US_ABI_IMPORT __declspec(dllimport)
#define US_ABI_LOCAL
#else
#define US_ABI_EXPORT __attribute__ ((visibility ("default")))
#define US_ABI_IMPORT __attribute__ ((visibility ("default")))
#define US_ABI_LOCAL __attribute__ ((visibility ("hidden")))
#endif
#ifdef US_BUILD_SHARED_LIBS
// We are building a shared lib
#ifdef CppMicroServices_EXPORTS
#define US_EXPORT US_ABI_EXPORT
#else
#define US_EXPORT US_ABI_IMPORT
#endif
#else
// We are building a static lib
// Don't hide RTTI symbols of definitions in the C++ Micro Services
// headers that are included in DSOs with hidden visibility
#define US_EXPORT US_ABI_EXPORT
#endif
//-------------------------------------------------------------------
// Namespace customization
//-------------------------------------------------------------------
#define US_NAMESPACE @US_NAMESPACE@
#ifndef US_NAMESPACE /* user namespace */
# define US_PREPEND_NAMESPACE(name) ::name
# define US_USE_NAMESPACE
# define US_BEGIN_NAMESPACE
# define US_END_NAMESPACE
# define US_FORWARD_DECLARE_CLASS(name) class name;
# define US_FORWARD_DECLARE_STRUCT(name) struct name;
#else /* user namespace */
# define US_PREPEND_NAMESPACE(name) ::US_NAMESPACE::name
# define US_USE_NAMESPACE using namespace ::US_NAMESPACE;
# define US_BEGIN_NAMESPACE namespace US_NAMESPACE {
# define US_END_NAMESPACE }
# define US_FORWARD_DECLARE_CLASS(name) \
US_BEGIN_NAMESPACE class name; US_END_NAMESPACE
# define US_FORWARD_DECLARE_STRUCT(name) \
US_BEGIN_NAMESPACE struct name; US_END_NAMESPACE
namespace US_NAMESPACE {}
#endif /* user namespace */
//-------------------------------------------------------------------
// Platform defines
//-------------------------------------------------------------------
#if defined(__APPLE__)
#define US_PLATFORM_APPLE
#endif
#if defined(__linux__)
#define US_PLATFORM_LINUX
#endif
#if defined(_WIN32) || defined(_WIN64)
#define US_PLATFORM_WINDOWS
#else
#define US_PLATFORM_POSIX
#endif
//-------------------------------------------------------------------
// Macros for suppressing warnings
//-------------------------------------------------------------------
#ifdef _MSC_VER
#define US_MSVC_PUSH_DISABLE_WARNING(wn) \
__pragma(warning(push)) \
__pragma(warning(disable:wn))
#define US_MSVC_POP_WARNING \
__pragma(warning(pop))
#define US_MSVC_DISABLE_WARNING(wn) \
__pragma(warning(disable:wn))
#else
#define US_MSVC_PUSH_DISABLE_WARNING(wn)
#define US_MSVC_POP_WARNING
#define US_MSVC_DISABLE_WARNING(wn)
#endif
// Do not warn about the usage of deprecated unsafe functions
US_MSVC_DISABLE_WARNING(4996)
// Mark a variable or expression result as unused
#define US_UNUSED(x) (void)(x)
//-------------------------------------------------------------------
// Debuging & Logging
//-------------------------------------------------------------------
#cmakedefine US_ENABLE_DEBUG_OUTPUT
US_BEGIN_NAMESPACE
enum MsgType { DebugMsg = 0, InfoMsg = 1, WarningMsg = 2, ErrorMsg = 3 };
typedef void (*MsgHandler)(MsgType, const char *);
US_EXPORT MsgHandler installMsgHandler(MsgHandler);
US_END_NAMESPACE
//-------------------------------------------------------------------
// Hash Container
//-------------------------------------------------------------------
#ifdef US_HAVE_UNORDERED_MAP_H
#include <unordered_map>
#elif defined(US_HAVE_TR1_UNORDERED_MAP_H)
#include <tr1/unordered_map>
#endif
#ifdef US_HAVE_UNORDERED_SET_H
#include <unordered_set>
#elif defined(US_HAVE_TR1_UNORDERED_SET_H)
#include <tr1/unordered_set>
#endif
#ifdef US_HAVE_STD_UNORDERED_MAP
#define US_UNORDERED_MAP_TYPE ::std::unordered_map
#elif defined(US_HAVE_TR1_UNORDERED_MAP)
#define US_UNORDERED_MAP_TYPE ::std::tr1::unordered_map
#endif
#ifdef US_HAVE_STD_UNORDERED_SET
#define US_UNORDERED_SET_TYPE ::std::unordered_set
#elif defined(US_HAVE_TR1_UNORDERED_SET)
#define US_UNORDERED_SET_TYPE ::std::tr1::unordered_set
#endif
#ifdef US_HAVE_STD_HASH
#define US_HASH_FUNCTION_NAMESPACE ::std
#ifdef US_HAVE_STD_HASH_STRUCT
#define US_HASH_FUNCTION_FRIEND(type) friend struct ::std::hash<type>
#elif defined(US_HAVE_STD_HASH_CLASS)
#define US_HASH_FUNCTION_FRIEND(type) friend class ::std::hash<type>
#endif
#define US_HASH_FUNCTION_NAMESPACE_BEGIN namespace std {
#define US_HASH_FUNCTION_NAMESPACE_END }
#elif defined(US_HAVE_TR1_HASH)
#define US_HASH_FUNCTION_NAMESPACE ::std::tr1
#ifdef US_HAVE_TR1_HASH_STRUCT
#define US_HASH_FUNCTION_FRIEND(type) friend struct ::std::tr1::hash<type>
#elif defined(US_HAVE_TR1_HASH_CLASS)
#define US_HASH_FUNCTION_FRIEND(type) friend class ::std::tr1::hash<type>
#endif
#define US_HASH_FUNCTION_NAMESPACE_BEGIN namespace std { namespace tr1 {
#define US_HASH_FUNCTION_NAMESPACE_END }}
#endif
#define US_HASH_FUNCTION_BEGIN(type) \
template<> \
struct hash<type> : std::unary_function<type, std::size_t> { \
std::size_t operator()(const type& arg) const {
#define US_HASH_FUNCTION_END } };
#define US_HASH_FUNCTION(type, arg) hash<type>()(arg)
#endif // USCONFIG_H