XTL
0.1
eXtended Template Library
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
xtd.hpp
Go to the documentation of this file.
1
9
#pragma once
10
11
#define XTD_GIT_IDENT "$Id: ce128cac6edf0e851fd74264289e048170925578 $"
12
13
#if !defined(ON)
14
#define ON 1
15
#endif
16
17
#if !defined(OFF)
18
#define OFF 0
19
#endif
20
21
#if !defined(YES)
22
#define YES 1
23
#endif
24
25
#if !defined(NO)
26
#define NO 0
27
#endif
28
29
#if !defined(DOXY_INVOKED)
30
#define DOXY_INVOKED 0
31
#endif
32
33
#if !defined(XTD_ASSETS_DIR)
34
#define XTD_ASSETS_DIR "/src/github/xtl/assets"
35
#endif
36
37
#if !defined(XTD_HAS_LIBUUID)
38
#define XTD_HAS_LIBUUID 1
39
#endif
40
41
#if !defined(XTD_COLOR_MESSAGES)
42
#define XTD_COLOR_MESSAGES 0
43
#endif
44
45
#if !defined(XTD_HAS_CODECVT)
46
#define XTD_HAS_CODECVT 0
47
#endif
48
49
#if !defined(XTD_HAS_EXP_CODECVT)
50
#define XTD_HAS_EXP_CODECVT 0
51
#endif
52
53
#if !defined(XTD_HAS_ICONV)
54
#define XTD_HAS_ICONV 0
55
#endif
56
57
#if !defined(XTD_HAS_FILESYSTEM)
58
#define XTD_HAS_FILESYSTEM 0
59
#endif
60
61
#if !defined(XTD_HAS_EXP_FILESYSTEM)
62
#define XTD_HAS_EXP_FILESYSTEM 0
63
#endif
64
65
#if !defined(XTD_USE_DBGHELP)
66
#define XTD_USE_DBGHELP OFF
67
#endif
68
71
#define XTD_COMPILER_MSVC 1
72
#define XTD_COMPILER_GCC 2
73
#define XTD_COMPILER XTD_COMPILER_GCC
74
79
#define XTD_CPU_ARM32 1
80
#define XTD_CPU_ARM64 2
81
#define XTD_CPU_PPC32 4
82
#define XTD_CPU_PPC64 8
83
#define XTD_CPU_X32 16
84
#define XTD_CPU_X64 32
85
90
#define XTD_OS_ANDROID 0x01
91
#define XTD_OS_BAREMETAL 0x02
92
#define XTD_OS_IOS 0x04
93
#define XTD_OS_LINUX 0x08
94
#define XTD_OS_WINDOWS 0x10
95
#define XTD_OS_CYGWIN 0x20
96
#define XTD_OS_MINGW 0x40
97
#define XTD_OS_MSYS 0x80
98
99
#if !defined(XTD_OS)
100
#define XTD_OS XTD_OS_LINUX
101
#endif
102
107
#define XTD_CHARSET_MBCS 1
108
#define XTD_CHARSET_UNICODE 2
109
110
#if !defined(XTD_CHARSET)
111
#define XTD_CHARSET XTD_CHARSET_MBCS
112
#endif
113
114
#if (XTD_CHARSET_UNICODE == XTD_CHARSET)
115
using
tchar = wchar_t;
116
#define __(x) L ## x
117
#else
118
using
tchar = char;
119
#define __(x) x
120
#endif
121
123
124
125
126
130
#define XTD_CONFIG_DEBUG 1
131
#define XTD_CONFIG_RELEASE 2
132
133
#if !defined(XTD_CONFIG)
134
#if defined(NDEBUG) || defined(RELEASE)
135
#define XTD_CONFIG XTD_CONFIG_RELEASE
136
#else
137
#define XTD_CONFIG XTD_CONFIG_DEBUG
138
#endif
139
#endif
140
141
#if (XTD_CONFIG_RELEASE == XTD_CONFIG)
142
#define D_(...)
143
#define R_(...) __VA_ARGS__
144
#else
145
#define D_(...) __VA_ARGS__
146
#define R_(...)
147
#endif
148
150
#define XTD_LOG_TARGET_SYSLOG 0
151
#define XTD_LOG_TARGET_WINDBG 0
152
#define XTD_LOG_TARGET_CSV 0
153
#define XTD_LOG_TARGET_COUT 0
154
#define XTD_LOG_TARGET_XML 0
155
158
#if !defined(NOMINMAX)
159
#define NOMINMAX
160
#endif
161
162
#define W_(x) L # x
163
164
#define QUOTE2_( x ) # x
165
#define QUOTE( x ) QUOTE2_( x )
166
167
#define CONCAT2_(x, y) x ## y
168
#define CONCAT(x, y) CONCAT2_(x,y)
169
170
#define DEFINE(x) x
171
172
#if defined(__COUNTER__)
173
#define UNIQUE_IDENTIFIER(_prefix) CONCAT(_prefix, __COUNTER__)
174
#else
175
#define UNIQUE_IDENTIFIER(_prefix) CONCAT(_prefix, __LINE__)
176
#endif
177
178
179
//__SONAR_OFF__
180
#if ((XTD_OS_WINDOWS | XTD_OS_MINGW) & XTD_OS)
181
#if !defined(_WIN32_WINNT)
182
#define _WIN32_WINNT 0x600
183
#endif
184
#endif
185
//__SONAR_ON__
186
187
188
#if (XTD_COMPILER_MSVC & XTD_COMPILER)
189
#define PACK_PUSH(n) __pragma(pack(push, n))
190
#define PACK_POP() __pragma(pack(pop))
191
#define FORCEINLINE __forceinline
192
#define NOVTABLE __declspec(novtable)
193
#define NORETURN __declspec(noreturn)
194
#define MULTIPLE __declspec(selectany)
195
#define ALIGN(val) __declspec(align(val))
196
#define EXPORT __declspec(dllexport)
197
#define TODO( x ) __pragma(message ( __FILE__ "(" QUOTE(__LINE__) ") : TODO : " x ))
198
#define NOTE( x ) __pragma(message ( __FILE__ "(" QUOTE(__LINE__) ") : NOTE : " x ))
199
#elif (XTD_COMPILER_GCC & XTD_COMPILER)
200
#define PRAGMA_(x) _Pragma( #x )
201
#define PACK_PUSH(n) PRAGMA_(pack(push, n))
202
#define PACK_POP() PRAGMA_(pack(pop))
203
#define FORCEINLINE __attribute__((always_inline))
204
#define NOVTABLE
205
#define NORETURN __attribute__((noreturn))
206
#define MULTIPLE __attribute__ ((weak))
207
#define ALIGN(val) __attribute__ ((aligned (val)))
208
#define EXPORT __attribute__ ((visibility ("default")))
209
#if XTD_COLOR_MESSAGES
210
#define TODO( x ) PRAGMA_(message ("\e[31mTODO : " x "\e[0m" ))
211
#define NOTE( x ) PRAGMA_(message ("\e[32mNOTE : " x "\e[0m"))
212
#else
213
#define TODO( x ) PRAGMA_(message ("TODO : " x ))
214
#define NOTE( x ) PRAGMA_(message ("NOTE : " x ))
215
#endif
216
#endif
217
218
#if !defined(XTD_VERBOSE_BUILD)
219
#define XTD_VERBOSE_BUILD 0
220
#endif
221
222
#if (!XTD_VERBOSE_BUILD)
223
#undef TODO
224
#undef NOTE
225
#define TODO(...)
226
#define NOTE(...)
227
#endif
228
229
#if (XTD_OS_MINGW & XTD_OS)
230
TODO(
"Enabled sealed keyword when available in mingw"
);
231
#define sealed
232
#endif
233
235
237
241
namespace
xtd{
245
namespace
_{}
247
253
namespace
concurrent{}
255
256
268
namespace
parse{}
270
271
278
namespace
socket{}
280
281
}
282
283
#define forever for(;;)
284
285
//System
286
#if (XTD_OS_LINUX & XTD_OS)
287
#if !defined(_GNU_SOURCE)
288
#define _GNU_SOURCE
289
#endif
290
#endif
291
292
#if ((XTD_OS_MINGW | XTD_OS_WINDOWS) & XTD_OS)
293
#include <winsock2.h>
294
#include <windows.h>
295
#include <Shlobj.h>
296
#endif
xtd
xtd.hpp
Generated on Tue Aug 23 2016 06:51:08 for XTL by
1.8.6