OnixS C++ Euronext Optiq MDG Handler  1.3.1
API documentation
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 #include <sstream>
23 
24 #if defined (_MSC_VER)
25 # define ONIXS_EURONEXT_OPTIQMDG_COMPILER_INFO ("MSVS")
26 #elif __GNUC__
27 inline
28 std::string compilerInfo()
29 {
30  std::stringstream ss;
31  ss << "gcc " << __VERSION__ << ", std=" << __cplusplus;
32  return ss.str();
33 }
34 # define ONIXS_EURONEXT_OPTIQMDG_COMPILER_INFO (compilerInfo())
35 #else
36 # define ONIXS_EURONEXT_OPTIQMDG_COMPILER_INFO ("Unknown")
37 #endif
38 
39 #if !(defined(ONIXS_EURONEXT_OPTIQMDG_DOXYGEN) && ONIXS_EURONEXT_OPTIQMDG_DOXYGEN)
40 
41 #include <OnixS/Euronext/MarketData/OptiqMdg/CompilerDetection.h>
42 
43 
44 #if defined(_MSC_VER) && defined(_MSVC_LANG)
45 # define ONIXS_EURONEXT_OPTIQMDG_CURRENT_CXX_STD _MSVC_LANG
46 #else
47 # define ONIXS_EURONEXT_OPTIQMDG_CURRENT_CXX_STD __cplusplus
48 #endif
49 
50 # if defined(ONIXS_EURONEXT_OPTIQMDG_CXX11)
51 # if (ONIXS_EURONEXT_OPTIQMDG_CURRENT_CXX_STD < 201103L)
52 # error C++11 was targeted during the OnixS SDK compilation but is not detected now
53 # endif
54 # endif
55 
56 # if defined(ONIXS_EURONEXT_OPTIQMDG_CXX14)
57 # if (ONIXS_EURONEXT_OPTIQMDG_CURRENT_CXX_STD < 201402L)
58 # error C++14 was targeted during the OnixS SDK compilation but is not detected now
59 # endif
60 # endif
61 
62 # if defined(ONIXS_EURONEXT_OPTIQMDG_CXX17)
63 # if (ONIXS_EURONEXT_OPTIQMDG_CURRENT_CXX_STD < 201703L)
64 # error C++17 was targeted during the OnixS SDK compilation but is not detected now
65 # endif
66 # endif
67 
68 # if defined(ONIXS_EURONEXT_OPTIQMDG_CXX20)
69 # if !(ONIXS_EURONEXT_OPTIQMDG_CURRENT_CXX_STD > 201703L)
70 # error C++20 was targeted during the OnixS SDK compilation but is not detected now
71 # endif
72 # endif
73 
74 # if defined(ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_GNU) | defined(ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_Clang)
75 # define ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_GNU_or_Clang
76 # endif
77 
78 # if defined(ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_GNU_or_Clang)
79 
80 # define ONIXS_EURONEXT_OPTIQMDG_LIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), true))
81 # define ONIXS_EURONEXT_OPTIQMDG_UNLIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), false))
82 # define ONIXS_EURONEXT_OPTIQMDG_UNUSED __attribute__((__unused__))
83 # define ONIXS_EURONEXT_OPTIQMDG_MAY_ALIAS __attribute__((__may_alias__))
84 # define ONIXS_EURONEXT_OPTIQMDG_HOTPATH __attribute__((hot))
85 # define ONIXS_EURONEXT_OPTIQMDG_COLDPATH __attribute__((noinline,cold))
86 # define ONIXS_EURONEXT_OPTIQMDG_NORETURN __attribute__ ((__noreturn__))
87 # define ONIXS_EURONEXT_OPTIQMDG_NODISCARD __attribute__((warn_unused_result))
88 # define ONIXS_EURONEXT_OPTIQMDG_PURE
89 
90 #elif defined(ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_MSVC)
91 
92 # define ONIXS_EURONEXT_OPTIQMDG_LIKELY(cond) ((cond))
93 # define ONIXS_EURONEXT_OPTIQMDG_UNLIKELY(cond) ((cond))
94 # define ONIXS_EURONEXT_OPTIQMDG_PURE
95 # define ONIXS_EURONEXT_OPTIQMDG_UNUSED
96 # define ONIXS_EURONEXT_OPTIQMDG_MAY_ALIAS
97 # define ONIXS_EURONEXT_OPTIQMDG_HOTPATH
98 # define ONIXS_EURONEXT_OPTIQMDG_COLDPATH
99 # define ONIXS_EURONEXT_OPTIQMDG_NORETURN __declspec(noreturn)
100 # define ONIXS_EURONEXT_OPTIQMDG_NODISCARD _Check_return_
101 
102 #else
103 # error Unsupported compiler
104 #endif
105 
106 # if defined(ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_GNU) & !defined(ONIXS_EURONEXT_OPTIQMDG_CXX11)
107 # define ONIXS_EURONEXT_OPTIQMDG_GCC44_SPURIOUS_WARNING_TURNAROUND ONIXS_EURONEXT_OPTIQMDG_MAY_ALIAS
108 # else
109 # define ONIXS_EURONEXT_OPTIQMDG_GCC44_SPURIOUS_WARNING_TURNAROUND
110 # endif
111 
112 
113 #if defined(ONIXS_EURONEXT_OPTIQMDG_CXX11)
114 
115 # define ONIXS_EURONEXT_OPTIQMDG_NOTHROW noexcept
116 # define ONIXS_EURONEXT_OPTIQMDG_CHECK_NOTHROW(equation) ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT(noexcept((equation)))
117 # define ONIXS_EURONEXT_OPTIQMDG_EXPLICIT explicit
118 # define ONIXS_EURONEXT_OPTIQMDG_CONST_OR_CONSTEXPR constexpr
119 # define ONIXS_EURONEXT_OPTIQMDG_FINAL final
120 # define ONIXS_EURONEXT_OPTIQMDG_OVERRIDE override
121 # define ONIXS_EURONEXT_OPTIQMDG_CONSTEXPR constexpr
122 # define ONIXS_EURONEXT_OPTIQMDG_NULLPTR nullptr
123 # define ONIXS_EURONEXT_OPTIQMDG_DELETED_FUNCTION = delete
124 # define ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT(X) static_assert(X, #X)
125 # define ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_MSG(X, MSG) static_assert(X, MSG)
126 # define ONIXS_EURONEXT_OPTIQMDG_ALIGNAS(X) alignas(X)
127 # define ONIXS_EURONEXT_OPTIQMDG_DEFAULT =default
128 
129 #else
130 
131 # define ONIXS_EURONEXT_OPTIQMDG_NOTHROW throw()
132 # define ONIXS_EURONEXT_OPTIQMDG_CHECK_NOTHROW(equation) ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT((true))
133 # define ONIXS_EURONEXT_OPTIQMDG_EXPLICIT
134 # define ONIXS_EURONEXT_OPTIQMDG_CONST_OR_CONSTEXPR const
135 # define ONIXS_EURONEXT_OPTIQMDG_FINAL
136 # define ONIXS_EURONEXT_OPTIQMDG_OVERRIDE
137 # define ONIXS_EURONEXT_OPTIQMDG_CONSTEXPR
138 # define ONIXS_EURONEXT_OPTIQMDG_DELETED_FUNCTION
139 # define ONIXS_EURONEXT_OPTIQMDG_DEFAULT {}
140 
141 
142 # if defined ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_GNU_or_Clang
143 # define ONIXS_EURONEXT_OPTIQMDG_NULLPTR __null
144 # else
145 # define ONIXS_EURONEXT_OPTIQMDG_NULLPTR 0
146 # endif
147 
148 
149 # define ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_JOIN(X, Y) ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_JOIN_IMPL(X, Y)
150 # define ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_JOIN_IMPL(X, Y) X##Y
151 template<bool> struct ONIXS_ILINK3StaticAssert;
152 template<> struct ONIXS_ILINK3StaticAssert<true>{};
153 # define ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT(X) enum { ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_JOIN(ONIXS_ILINK3StaticAssertEnum, __LINE__) = sizeof(ONIXS_ILINK3StaticAssert<X>) }
154 # define ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_MSG(X, MSG) enum { ONIXS_EURONEXT_OPTIQMDG_STATIC_ASSERT_JOIN(ONIXS_ILINK3StaticAssertEnum, __LINE__) = sizeof(ONIXS_ILINK3StaticAssert<X>) }
155 
156 
157 # if defined ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_GNU_or_Clang
158 # define ONIXS_EURONEXT_OPTIQMDG_ALIGNAS(X) __attribute__ ((__aligned__(X)))
159 # elif defined ONIXS_EURONEXT_OPTIQMDG_COMPILER_IS_MSVC
160 # define ONIXS_EURONEXT_OPTIQMDG_ALIGNAS(X) __declspec(align(X))
161 # else
162 # define ONIXS_EURONEXT_OPTIQMDG_ALIGNAS(X)
163 # endif
164 
165 #endif
166 
167 #if defined NDEBUG
168 # define ONIXS_EURONEXT_OPTIQMDG_ASSERT(CHECK) static_cast<void>((CHECK))
169 #else
170 #if defined (ONIXS_EURONEXT_OPTIQMDG_CXX11)
171 # define ONIXS_EURONEXT_OPTIQMDG_ASSERT(CHECK) ((CHECK) ? void(0) : []() {assert(!#CHECK);}())
172 # else
173 # define ONIXS_EURONEXT_OPTIQMDG_ASSERT(CHECK) (assert((CHECK)))
174 # endif
175 #endif
176 
177 #if defined (ONIXS_EURONEXT_OPTIQMDG_CXX11)
178 # define ONIXS_EURONEXT_OPTIQMDG_HAS_TYPE_TRAITS
179 #endif
180 
181 #define ONIXS_EURONEXT_OPTIQMDG_HARDWARE_DESTRUCTIVE_INTERFACE_SIZE (64)
182 
183 #else //#if !(defined(ONIXS_DOXYGEN) && ONIXS_DOXYGEN)
184 
185 #define ONIXS_EURONEXT_OPTIQMDG_EXPORTED
186 #define ONIXS_EURONEXT_OPTIQMDG_NOTHROW noexcept
187 #define ONIXS_EURONEXT_OPTIQMDG_EXPLICIT explicit
188 #define ONIXS_EURONEXT_OPTIQMDG_CONST_OR_CONSTEXPR constexpr
189 #define ONIXS_EURONEXT_OPTIQMDG_CONSTEXPR constexpr
190 #define ONIXS_EURONEXT_OPTIQMDG_OVERRIDE override
191 #define ONIXS_EURONEXT_OPTIQMDG_FINAL final
192 #define ONIXS_EURONEXT_OPTIQMDG_NULLPTR nullptr
193 
194 #define ONIXS_EURONEXT_OPTIQMDG_NORETURN
195 #define ONIXS_EURONEXT_OPTIQMDG_NODISCARD
196 
197 #define ONIXS_EURONEXT_OPTIQMDG_HOTPATH
198 #define ONIXS_EURONEXT_OPTIQMDG_COLDPATH
199 #define ONIXS_EURONEXT_OPTIQMDG_PURE
200 
201 #define ONIXS_EURONEXT_OPTIQMDG_HAS_TYPE_TRAITS
202 
203 #define ONIXS_EURONEXT_OPTIQMDG_HAS_GATEWAY_EMULATOR
204 
205 #define ONIXS_EURONEXT_OPTIQMDG_CXX11
206 #define ONIXS_EURONEXT_OPTIQMDG_CXX14
207 #define ONIXS_EURONEXT_OPTIQMDG_CXX17
208 #define ONIXS_EURONEXT_OPTIQMDG_CXX20
209 
210 
211 #define ONIXS_EURONEXT_OPTIQMDG_UNUSED
212 #define ONIXS_EURONEXT_OPTIQMDG_DEFAULT =default
213 
214 #define ONIXS_EURONEXT_OPTIQMDG_GCC44_SPURIOUS_WARNING_TURNAROUND
215 
216 #endif