OnixS C++ B3 Binary UMDF Market Data Handler
1.6.3
API documentation
Home
Contents
Namespaces
Classes
Files
File List
File Members
OnixS
B3
MarketData
UMDF
Compiler.h
Go to the documentation of this file.
1
/*
2
* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3
*
4
* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5
* and international copyright treaties.
6
*
7
* Access to and use of the software is governed by the terms of the applicable ONIXS Software
8
* Services Agreement (the Agreement) and Customer end user license agreements granting
9
* a non-assignable, non-transferable and non-exclusive license to use the software
10
* for it's own data processing purposes under the terms defined in the Agreement.
11
*
12
* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13
* of this source code or associated reference material to any other location for further reproduction
14
* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15
*
16
* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17
* the terms of the Agreement is a violation of copyright law.
18
*/
19
20
#pragma once
21
22
#if !(defined(ONIXS_B3_UMDF_MD_DOXYGEN) && ONIXS_B3_UMDF_MD_DOXYGEN)
23
24
#include <OnixS/B3/MarketData/UMDF/CompilerDetection.h>
25
26
27
#if defined(_MSC_VER) && defined(_MSVC_LANG)
28
# define ONIXS_B3_UMDF_MD_CURRENT_CXX_STD _MSVC_LANG
29
#else
30
# define ONIXS_B3_UMDF_MD_CURRENT_CXX_STD __cplusplus
31
#endif
32
33
# if defined(ONIXS_B3_UMDF_MD_CXX11)
34
# if (ONIXS_B3_UMDF_MD_CURRENT_CXX_STD < 201103L)
35
# error C++11 was targeted during the OnixS SDK compilation but is not detected now
36
# endif
37
# endif
38
39
# if defined(ONIXS_B3_UMDF_MD_CXX14)
40
# if (ONIXS_B3_UMDF_MD_CURRENT_CXX_STD < 201402L)
41
# error C++14 was targeted during the OnixS SDK compilation but is not detected now
42
# endif
43
# endif
44
45
# if defined(ONIXS_B3_UMDF_MD_CXX17)
46
# if (ONIXS_B3_UMDF_MD_CURRENT_CXX_STD < 201703L)
47
# error C++17 was targeted during the OnixS SDK compilation but is not detected now
48
# endif
49
# endif
50
51
# if defined(ONIXS_B3_UMDF_MD_CXX20)
52
# if !(ONIXS_B3_UMDF_MD_CURRENT_CXX_STD > 201703L)
53
# error C++20 was targeted during the OnixS SDK compilation but is not detected now
54
# endif
55
# endif
56
57
# if defined(ONIXS_B3_UMDF_MD_CXX14)
58
# define ONIXS_B3_UMDF_MD_CXX14_CONSTEXPR constexpr
59
#else
60
# define ONIXS_B3_UMDF_MD_CXX14_CONSTEXPR
61
# endif
62
63
# if defined(ONIXS_B3_UMDF_MD_COMPILER_IS_GNU) | defined(ONIXS_B3_UMDF_MD_COMPILER_IS_Clang)
64
# define ONIXS_B3_UMDF_MD_COMPILER_IS_GNU_or_Clang
65
# endif
66
67
# if defined(ONIXS_B3_UMDF_MD_COMPILER_IS_GNU_or_Clang)
68
69
# define ONIXS_B3_UMDF_MD_LIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), true))
70
# define ONIXS_B3_UMDF_MD_UNLIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), false))
71
# define ONIXS_B3_UMDF_MD_UNUSED __attribute__((__unused__))
72
# define ONIXS_B3_UMDF_MD_MAY_ALIAS __attribute__((__may_alias__))
73
# define ONIXS_B3_UMDF_MD_HOTPATH __attribute__((hot))
74
# define ONIXS_B3_UMDF_MD_COLDPATH __attribute__((noinline,cold))
75
# define ONIXS_B3_UMDF_MD_NORETURN __attribute__ ((__noreturn__))
76
# define ONIXS_B3_UMDF_MD_NODISCARD __attribute__((warn_unused_result))
77
# define ONIXS_B3_UMDF_MD_PURE
78
79
#elif defined(ONIXS_B3_UMDF_MD_COMPILER_IS_MSVC)
80
81
# define ONIXS_B3_UMDF_MD_LIKELY(cond) ((cond))
82
# define ONIXS_B3_UMDF_MD_UNLIKELY(cond) ((cond))
83
# define ONIXS_B3_UMDF_MD_PURE
84
# define ONIXS_B3_UMDF_MD_UNUSED
85
# define ONIXS_B3_UMDF_MD_MAY_ALIAS
86
# define ONIXS_B3_UMDF_MD_HOTPATH
87
# define ONIXS_B3_UMDF_MD_COLDPATH
88
# define ONIXS_B3_UMDF_MD_NORETURN __declspec(noreturn)
89
# define ONIXS_B3_UMDF_MD_NODISCARD _Check_return_
90
91
#else
92
# error Unsupported compiler
93
#endif
94
95
# if defined(ONIXS_B3_UMDF_MD_COMPILER_IS_GNU) & !defined(ONIXS_B3_UMDF_MD_CXX11)
96
# define ONIXS_B3_UMDF_MD_GCC44_SPURIOUS_WARNING_TURNAROUND ONIXS_B3_UMDF_MD_MAY_ALIAS
97
# else
98
# define ONIXS_B3_UMDF_MD_GCC44_SPURIOUS_WARNING_TURNAROUND
99
# endif
100
101
102
#if defined(ONIXS_B3_UMDF_MD_CXX11)
103
104
# define ONIXS_B3_UMDF_MD_NOTHROW noexcept
105
# define ONIXS_B3_UMDF_MD_CHECK_NOTHROW(equation) ONIXS_B3_UMDF_MD_STATIC_ASSERT(noexcept((equation)))
106
# define ONIXS_B3_UMDF_MD_EXPLICIT explicit
107
# define ONIXS_B3_UMDF_MD_CONST_OR_CONSTEXPR constexpr
108
# define ONIXS_B3_UMDF_MD_FINAL final
109
# define ONIXS_B3_UMDF_MD_OVERRIDE override
110
# define ONIXS_B3_UMDF_MD_CONSTEXPR constexpr
111
# define ONIXS_B3_UMDF_MD_NULLPTR nullptr
112
# define ONIXS_B3_UMDF_MD_DELETED_FUNCTION = delete
113
# define ONIXS_B3_UMDF_MD_STATIC_ASSERT(X) static_assert(X, #X)
114
# define ONIXS_B3_UMDF_MD_STATIC_ASSERT_MSG(X, MSG) static_assert(X, MSG)
115
# define ONIXS_B3_UMDF_MD_ALIGNAS(X) alignas(X)
116
# define ONIXS_B3_UMDF_MD_DEFAULT =default
117
118
#else
119
120
# define ONIXS_B3_UMDF_MD_NOTHROW throw()
121
# define ONIXS_B3_UMDF_MD_CHECK_NOTHROW(equation) ONIXS_B3_UMDF_MD_STATIC_ASSERT((true))
122
# define ONIXS_B3_UMDF_MD_EXPLICIT
123
# define ONIXS_B3_UMDF_MD_CONST_OR_CONSTEXPR const
124
# define ONIXS_B3_UMDF_MD_FINAL
125
# define ONIXS_B3_UMDF_MD_OVERRIDE
126
# define ONIXS_B3_UMDF_MD_CONSTEXPR
127
# define ONIXS_B3_UMDF_MD_DELETED_FUNCTION
128
# define ONIXS_B3_UMDF_MD_DEFAULT {}
129
130
131
# if defined ONIXS_B3_UMDF_MD_COMPILER_IS_GNU_or_Clang
132
# define ONIXS_B3_UMDF_MD_NULLPTR __null
133
# else
134
# define ONIXS_B3_UMDF_MD_NULLPTR 0
135
# endif
136
137
138
# define ONIXS_B3_UMDF_MD_STATIC_ASSERT_JOIN(X, Y) ONIXS_B3_UMDF_MD_STATIC_ASSERT_JOIN_IMPL(X, Y)
139
# define ONIXS_B3_UMDF_MD_STATIC_ASSERT_JOIN_IMPL(X, Y) X##Y
140
template
<
bool
>
struct
ONIXS_ILINK3StaticAssert
;
141
template
<>
struct
ONIXS_ILINK3StaticAssert
<true>{};
142
# define ONIXS_B3_UMDF_MD_STATIC_ASSERT(X) enum { ONIXS_B3_UMDF_MD_STATIC_ASSERT_JOIN(ONIXS_ILINK3StaticAssertEnum, __LINE__) = sizeof(ONIXS_ILINK3StaticAssert<X>) }
143
# define ONIXS_B3_UMDF_MD_STATIC_ASSERT_MSG(X, MSG) enum { ONIXS_B3_UMDF_MD_STATIC_ASSERT_JOIN(ONIXS_ILINK3StaticAssertEnum, __LINE__) = sizeof(ONIXS_ILINK3StaticAssert<X>) }
144
145
146
# if defined ONIXS_B3_UMDF_MD_COMPILER_IS_GNU_or_Clang
147
# define ONIXS_B3_UMDF_MD_ALIGNAS(X) __attribute__ ((__aligned__(X)))
148
# elif defined ONIXS_B3_UMDF_MD_COMPILER_IS_MSVC
149
# define ONIXS_B3_UMDF_MD_ALIGNAS(X) __declspec(align(X))
150
# else
151
# define ONIXS_B3_UMDF_MD_ALIGNAS(X)
152
# endif
153
154
#endif
155
156
#if defined NDEBUG
157
# define ONIXS_B3_UMDF_MD_ASSERT(CHECK) static_cast<void>((CHECK))
158
#else
159
#if defined (ONIXS_B3_UMDF_MD_CXX11)
160
# define ONIXS_B3_UMDF_MD_ASSERT(CHECK) ((CHECK) ? void(0) : []() {assert(!#CHECK);}())
161
# else
162
# define ONIXS_B3_UMDF_MD_ASSERT(CHECK) (assert((CHECK)))
163
# endif
164
#endif
165
166
#if defined (ONIXS_B3_UMDF_MD_CXX11)
167
# define ONIXS_B3_UMDF_MD_HAS_TYPE_TRAITS
168
#endif
169
170
#define ONIXS_B3_UMDF_MD_HARDWARE_DESTRUCTIVE_INTERFACE_SIZE (64)
171
172
#else //#if !(defined(ONIXS_DOXYGEN) && ONIXS_DOXYGEN)
173
174
#define ONIXS_B3_UMDF_MD_EXPORTED
175
#define ONIXS_B3_UMDF_MD_NOTHROW noexcept
176
#define ONIXS_B3_UMDF_MD_EXPLICIT explicit
177
#define ONIXS_B3_UMDF_MD_CONST_OR_CONSTEXPR constexpr
178
#define ONIXS_B3_UMDF_MD_CONSTEXPR constexpr
179
#define ONIXS_B3_UMDF_MD_OVERRIDE override
180
#define ONIXS_B3_UMDF_MD_FINAL final
181
#define ONIXS_B3_UMDF_MD_NULLPTR nullptr
182
183
#define ONIXS_B3_UMDF_MD_NORETURN
184
#define ONIXS_B3_UMDF_MD_NODISCARD
185
186
#define ONIXS_B3_UMDF_MD_HOTPATH
187
#define ONIXS_B3_UMDF_MD_COLDPATH
188
#define ONIXS_B3_UMDF_MD_PURE
189
190
#define ONIXS_B3_UMDF_MD_HAS_TYPE_TRAITS
191
192
#define ONIXS_B3_UMDF_MD_HAS_GATEWAY_EMULATOR
193
194
#define ONIXS_B3_UMDF_MD_CXX11
195
#define ONIXS_B3_UMDF_MD_CXX14
196
#define ONIXS_B3_UMDF_MD_CXX17
197
#define ONIXS_B3_UMDF_MD_CXX20
198
199
200
#define ONIXS_B3_UMDF_MD_UNUSED
201
#define ONIXS_B3_UMDF_MD_DEFAULT =default
202
203
#define ONIXS_B3_UMDF_MD_GCC44_SPURIOUS_WARNING_TURNAROUND
204
205
#endif
ONIXS_ILINK3StaticAssert
Definition:
Compiler.h:140