OnixS C++ CME MDP Conflated TCP Handler  1.2.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 #if !(defined(ONIXS_CONFLATEDTCP_DOXYGEN) && ONIXS_CONFLATEDTCP_DOXYGEN)
23 
25 
26 #if defined(__GNUC__)
27 #define ONIXS_CONFLATEDTCP_MAY_ALIAS __attribute__((__may_alias__))
28 #else
29 #define ONIXS_CONFLATEDTCP_MAY_ALIAS
30 #endif
31 
32 // https://bugzilla.redhat.com/show_bug.cgi?id=702984
33 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
34 #define ONIXS_CONFLATEDTCP_GCC44_SPURIOUS_WARNING_TURNAROUND ONIXS_CONFLATEDTCP_MAY_ALIAS
35 #else
36 #define ONIXS_CONFLATEDTCP_GCC44_SPURIOUS_WARNING_TURNAROUND
37 #endif
38 
39 
40 # if defined(ONIXS_CONFLATEDTCP_COMPILER_CXX_NOEXCEPT) && ONIXS_CONFLATEDTCP_COMPILER_CXX_NOEXCEPT
41 # define ONIXS_CONFLATEDTCP_NOTHROW noexcept
42 # else
43 # define ONIXS_CONFLATEDTCP_NOTHROW throw()
44 # endif
45 
46 # if defined(ONIXS_CONFLATEDTCP_COMPILER_CXX_NOEXCEPT) && ONIXS_CONFLATEDTCP_COMPILER_CXX_NOEXCEPT
47 # define ONIXS_CONFLATEDTCP_CHECK_NOTHROW(equation) ONIXS_CONFLATEDTCP_STATIC_ASSERT(noexcept((equation)))
48 # else
49 # define ONIXS_CONFLATEDTCP_CHECK_NOTHROW(equation) ONIXS_CONFLATEDTCP_STATIC_ASSERT((true))
50 # endif
51 
52 # if defined(ONIXS_CONFLATEDTCP_COMPILER_CXX_EXPLICIT_CONVERSIONS) && ONIXS_CONFLATEDTCP_COMPILER_CXX_EXPLICIT_CONVERSIONS
53 # define ONIXS_CONFLATEDTCP_EXPLICIT explicit
54 #else
55 # define ONIXS_CONFLATEDTCP_EXPLICIT
56 #endif
57 
58 #if (__cplusplus >= 201103L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
59 # define ONIXS_CONFLATEDTCP_CXX11
60 #endif
61 
62 #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
63 # define ONIXS_CONFLATEDTCP_CXX17
64 #endif
65 
66 # if defined(ONIXS_CONFLATEDTCP_COMPILER_CXX_CONSTEXPR) && ONIXS_CONFLATEDTCP_COMPILER_CXX_CONSTEXPR
67 # define ONIXS_CONFLATEDTCP_CONST_OR_CONSTEXPR constexpr
68 #else
69 # define ONIXS_CONFLATEDTCP_CONST_OR_CONSTEXPR const
70 #endif
71 
72 #if defined(__GNUC__)
73 # define ONIXS_CONFLATEDTCP_CHECK_EXPECT(exp,c) (__builtin_expect((exp), (c)))
74 #else
75 # define ONIXS_CONFLATEDTCP_CHECK_EXPECT(exp,c) ((exp))
76 #endif
77 
78 #if !defined(ONIXS_CONFLATEDTCP_NORETURN)
79 # if defined(_MSC_VER)
80 # define ONIXS_CONFLATEDTCP_NORETURN __declspec(noreturn)
81 # elif defined(__GNUC__)
82 # define ONIXS_CONFLATEDTCP_NORETURN __attribute__ ((__noreturn__))
83 # elif defined(__has_cpp_attribute)
84 # if __has_cpp_attribute(noreturn)
85 # define ONIXS_CONFLATEDTCP_NORETURN [[noreturn]]
86 # endif
87 # endif
88 #endif
89 
90 #if !defined(ONIXS_CONFLATEDTCP_NORETURN)
91 # define ONIXS_CONFLATEDTCP_NORETURN
92 #endif
93 
94 
95 #if !defined(ONIXS_CONFLATEDTCP_NODISCARD)
96 # if defined(_MSC_VER)
97 # define ONIXS_CONFLATEDTCP_NODISCARD _Check_return_
98 # elif defined(__GNUC__)
99 # define ONIXS_CONFLATEDTCP_NODISCARD __attribute__((warn_unused_result))
100 # elif defined(__has_cpp_attribute)
101 # if __has_cpp_attribute(nodiscard)
102 # define ONIXS_CONFLATEDTCP_NODISCARD [[nodiscard]]
103 # endif
104 # endif
105 #endif
106 
107 #if !defined(ONIXS_CONFLATEDTCP_NODISCARD)
108 # define ONIXS_CONFLATEDTCP_NODISCARD
109 #endif
110 
111 #if defined(__GNUC__)
112 # define ONIXS_CONFLATEDTCP_UNUSED __attribute__((__unused__))
113 #else
114 # define ONIXS_CONFLATEDTCP_UNUSED
115 #endif
116 
117 #if defined(__GNUC__)
118 # define ONIXS_CONFLATEDTCP_HOTPATH __attribute__((hot))
119 # define ONIXS_CONFLATEDTCP_COLDPATH __attribute__((cold))
120 #else
121 # define ONIXS_CONFLATEDTCP_COLDPATH
122 # define ONIXS_CONFLATEDTCP_HOTPATH
123 #endif
124 
125 
126 #if defined(__GNUC__)
127 # define ONIXS_CONFLATEDTCP_LIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), true))
128 # define ONIXS_CONFLATEDTCP_UNLIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), false))
129 #else
130 # if defined(__has_cpp_attribute)
131 # if __has_cpp_attribute(unlikely)
132 # define ONIXS_CONFLATEDTCP_UNLIKELY(cond) ((cond)) [[unlikely]]
133 # define ONIXS_CONFLATEDTCP_LIKELY(cond) ((cond)) [[likely]]
134 # endif
135 # endif
136 #endif
137 
138 #if !defined(ONIXS_CONFLATEDTCP_LIKELY)
139 # define ONIXS_CONFLATEDTCP_LIKELY(cond) ((cond))
140 #endif
141 
142 #if !defined(ONIXS_CONFLATEDTCP_UNLIKELY)
143 # define ONIXS_CONFLATEDTCP_UNLIKELY(cond) ((cond))
144 #endif
145 
146 #if defined(__GNUC__) && !defined(__clang__)
147 # define ONIXS_CONFLATEDTCP_PURE __attribute__((pure))
148 #else
149 # define ONIXS_CONFLATEDTCP_PURE
150 #endif
151 
152 #if defined (ONIXS_CONFLATEDTCP_CXX11)
153 # define ONIXS_CONFLATEDTCP_HAS_TYPE_TRAITS
154 #endif
155 
156 #if defined(ONIXS_CONFLATEDTCP_CXX17)
157 # define ONIXS_CONFLATEDTCP_HAS_STRING_VIEW
158 #endif
159 
160 #if defined(ONIXS_CONFLATEDTCP_CXX11)
161 # define ONIXS_CONFLATEDTCP_HAS_GATEWAY_EMULATOR
162 #endif
163 
164 #define ONIXS_CONFLATEDTCP_DEFAULT {}
165 
166 #if defined NDEBUG
167 # define ONIXS_CONFLATEDTCP_ASSERT(CHECK) void(0)
168 #else
169 # if !defined(ONIXS_CONFLATEDTCP_CXX11)
170 # define ONIXS_CONFLATEDTCP_ASSERT(CHECK) (assert((CHECK)))
171 # else
172 # define ONIXS_CONFLATEDTCP_ASSERT(CHECK) \
173  ((CHECK) ? void(0) : []() {assert(!#CHECK);}())
174 # endif
175 #endif
176 
177 #if defined(__clang__)
178 #define ONIXS_CONFLATEDTCP_PADDING(size) __attribute__((__unused__)) Byte padding##__LINE__[size]
179 #else
180 #define ONIXS_CONFLATEDTCP_PADDING(size) Byte padding##__LINE__[size]
181 #endif
182 
183 #define ONIXS_CONFLATEDTCP_HARDWARE_DESTRUCTIVE_INTERFACE_SIZE (64)
184 
185 #else //#if !(defined(ONIXS_DOXYGEN) && ONIXS_DOXYGEN)
186 
187 #define ONIXS_CONFLATEDTCP_EXPORTED
188 #define ONIXS_CONFLATEDTCP_GCC44_SPURIOUS_WARNING_TURNAROUND
189 #define ONIXS_CONFLATEDTCP_NOTHROW noexcept
190 #define ONIXS_CONFLATEDTCP_EXPLICIT explicit
191 #define ONIXS_CONFLATEDTCP_CONST_OR_CONSTEXPR constexpr
192 #define ONIXS_CONFLATEDTCP_CONSTEXPR constexpr
193 #define ONIXS_CONFLATEDTCP_OVERRIDE override
194 #define ONIXS_CONFLATEDTCP_FINAL final
195 #define ONIXS_CONFLATEDTCP_COMPILER_CXX_NULLPTR nullptr
196 
197 #define ONIXS_CONFLATEDTCP_NORETURN
198 #define ONIXS_CONFLATEDTCP_NODISCARD
199 
200 #define ONIXS_CONFLATEDTCP_HOTPATH
201 #define ONIXS_CONFLATEDTCP_COLDPATH
202 #define ONIXS_CONFLATEDTCP_PURE
203 
204 #define ONIXS_CONFLATEDTCP_HAS_TYPE_TRAITS
205 #define ONIXS_CONFLATEDTCP_HAS_STRING_VIEW
206 
207 #define ONIXS_CONFLATEDTCP_HAS_GATEWAY_EMULATOR
208 
209 #define ONIXS_CONFLATEDTCP_COMPILER_CXX_ALIAS_TEMPLATES 1
210 #define ONIXS_CONFLATEDTCP_COMPILER_CXX_RVALUE_REFERENCES 1
211 #define ONIXS_CONFLATEDTCP_CXX11
212 
213 #endif