OnixS C++ CME MDP Conflated TCP Handler
1.3.6
API Documentation
Home
Contents
Namespaces
Classes
Files
File List
File Members
OnixS
CME
ConflatedTCP
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
24
#include <
OnixS/CME/ConflatedTCP/CompilerDetection.h
>
25
26
#if defined(_MSC_VER) && defined(_MSVC_LANG)
27
# define ONIXS_CURRENT_CXX_STD _MSVC_LANG
28
#else
29
# define ONIXS_CURRENT_CXX_STD __cplusplus
30
#endif
31
32
# if defined(ONIXS_CONFLATEDTCP_CXX11)
33
# if (ONIXS_CURRENT_CXX_STD < 201103L)
34
# error C++11 was targeted during the OnixS SDK compilation but is not detected now
35
# endif
36
# endif
37
38
# if defined(ONIXS_CONFLATEDTCP_CXX14)
39
# if (ONIXS_CURRENT_CXX_STD < 201402L)
40
# error C++14 was targeted during the OnixS SDK compilation but is not detected now
41
# endif
42
# endif
43
44
# if defined(ONIXS_CONFLATEDTCP_CXX17)
45
# if (ONIXS_CURRENT_CXX_STD < 201703L)
46
# error C++17 was targeted during the OnixS SDK compilation but is not detected now
47
# endif
48
# endif
49
50
# if defined(ONIXS_CONFLATEDTCP_CXX20)
51
# if !(ONIXS_CURRENT_CXX_STD > 201703L)
52
# error C++20 was targeted during the OnixS SDK compilation but is not detected now
53
# endif
54
# endif
55
56
# if defined(ONIXS_CONFLATEDTCP_COMPILER_IS_GNU) | defined(ONIXS_CONFLATEDTCP_COMPILER_IS_Clang)
57
# define ONIXS_CONFLATEDTCP_COMPILER_IS_GNU_or_Clang
58
# endif
59
60
# if defined(ONIXS_CONFLATEDTCP_COMPILER_IS_GNU_or_Clang)
61
62
# define ONIXS_CONFLATEDTCP_LIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), true))
63
# define ONIXS_CONFLATEDTCP_UNLIKELY(cond) (__builtin_expect((static_cast<bool>((cond))), false))
64
# define ONIXS_CONFLATEDTCP_UNUSED __attribute__((__unused__))
65
# define ONIXS_CONFLATEDTCP_MAY_ALIAS __attribute__((__may_alias__))
66
# define ONIXS_CONFLATEDTCP_HOTPATH __attribute__((hot))
67
# define ONIXS_CONFLATEDTCP_COLDPATH __attribute__((noinline,cold))
68
# define ONIXS_CONFLATEDTCP_NORETURN __attribute__ ((__noreturn__))
69
# define ONIXS_CONFLATEDTCP_NODISCARD __attribute__((warn_unused_result))
70
# define ONIXS_CONFLATEDTCP_PURE
71
72
#elif defined(ONIXS_CONFLATEDTCP_COMPILER_IS_MSVC)
73
74
# define ONIXS_CONFLATEDTCP_LIKELY(cond) ((cond))
75
# define ONIXS_CONFLATEDTCP_UNLIKELY(cond) ((cond))
76
# define ONIXS_CONFLATEDTCP_PURE
77
# define ONIXS_CONFLATEDTCP_UNUSED
78
# define ONIXS_CONFLATEDTCP_MAY_ALIAS
79
# define ONIXS_CONFLATEDTCP_HOTPATH
80
# define ONIXS_CONFLATEDTCP_COLDPATH
81
# define ONIXS_CONFLATEDTCP_NORETURN __declspec(noreturn)
82
# define ONIXS_CONFLATEDTCP_NODISCARD _Check_return_
83
84
#else
85
# error Unsupported compiler
86
#endif
87
88
# if defined(ONIXS_CONFLATEDTCP_COMPILER_IS_GNU) & !defined(ONIXS_CONFLATEDTCP_CXX11)
89
# define ONIXS_CONFLATEDTCP_GCC44_SPURIOUS_WARNING_TURNAROUND ONIXS_CONFLATEDTCP_MAY_ALIAS
90
# else
91
# define ONIXS_CONFLATEDTCP_GCC44_SPURIOUS_WARNING_TURNAROUND
92
# endif
93
94
# if defined(ONIXS_CONFLATEDTCP_COMPILER_IS_Clang)
95
# define ONIXS_CONFLATEDTCP_PADDING(size) __attribute__((__unused__)) Byte padding##__LINE__[size]
96
#else
97
# define ONIXS_CONFLATEDTCP_PADDING(size) Byte padding##__LINE__[size]
98
# endif
99
100
101
#if defined(ONIXS_CONFLATEDTCP_CXX11)
102
103
# define ONIXS_CONFLATEDTCP_NOTHROW noexcept
104
# define ONIXS_CONFLATEDTCP_CHECK_NOTHROW(equation) ONIXS_CONFLATEDTCP_STATIC_ASSERT(noexcept((equation)))
105
# define ONIXS_CONFLATEDTCP_EXPLICIT explicit
106
# define ONIXS_CONFLATEDTCP_CONST_OR_CONSTEXPR constexpr
107
# define ONIXS_CONFLATEDTCP_FINAL final
108
# define ONIXS_CONFLATEDTCP_OVERRIDE override
109
# define ONIXS_CONFLATEDTCP_CONSTEXPR constexpr
110
# define ONIXS_CONFLATEDTCP_NULLPTR nullptr
111
# define ONIXS_CONFLATEDTCP_DELETED_FUNCTION = delete
112
# define ONIXS_CONFLATEDTCP_STATIC_ASSERT(X) static_assert(X, #X)
113
# define ONIXS_CONFLATEDTCP_STATIC_ASSERT_MSG(X, MSG) static_assert(X, MSG)
114
# define ONIXS_CONFLATEDTCP_ALIGNAS(X) alignas(X)
115
# define ONIXS_CONFLATEDTCP_DEFAULT =default
116
117
#define ONIXS_CONFLATEDTCP_HAS_GATEWAY_EMULATOR
118
119
#else
120
121
# define ONIXS_CONFLATEDTCP_NOTHROW throw()
122
# define ONIXS_CONFLATEDTCP_CHECK_NOTHROW(equation) ONIXS_CONFLATEDTCP_STATIC_ASSERT((true))
123
# define ONIXS_CONFLATEDTCP_EXPLICIT
124
# define ONIXS_CONFLATEDTCP_CONST_OR_CONSTEXPR const
125
# define ONIXS_CONFLATEDTCP_FINAL
126
# define ONIXS_CONFLATEDTCP_OVERRIDE
127
# define ONIXS_CONFLATEDTCP_CONSTEXPR
128
# define ONIXS_CONFLATEDTCP_DELETED_FUNCTION
129
# define ONIXS_CONFLATEDTCP_DEFAULT {}
130
131
132
# if defined ONIXS_CONFLATEDTCP_COMPILER_IS_GNU_or_Clang
133
# define ONIXS_CONFLATEDTCP_NULLPTR __null
134
# else
135
# define ONIXS_CONFLATEDTCP_NULLPTR 0
136
# endif
137
138
139
# define ONIXS_CONFLATEDTCP_STATIC_ASSERT_JOIN(X, Y) ONIXS_CONFLATEDTCP_STATIC_ASSERT_JOIN_IMPL(X, Y)
140
# define ONIXS_CONFLATEDTCP_STATIC_ASSERT_JOIN_IMPL(X, Y) X##Y
141
template
<
bool
>
struct
ONIXS_ILINK3StaticAssert;
142
template
<>
struct
ONIXS_ILINK3StaticAssert<true>{};
143
# define ONIXS_CONFLATEDTCP_STATIC_ASSERT(X) enum { ONIXS_CONFLATEDTCP_STATIC_ASSERT_JOIN(ONIXS_ILINK3StaticAssertEnum, __LINE__) = sizeof(ONIXS_ILINK3StaticAssert<X>) }
144
# define ONIXS_CONFLATEDTCP_STATIC_ASSERT_MSG(X, MSG) enum { ONIXS_CONFLATEDTCP_STATIC_ASSERT_JOIN(ONIXS_ILINK3StaticAssertEnum, __LINE__) = sizeof(ONIXS_ILINK3StaticAssert<X>) }
145
146
147
# if defined ONIXS_CONFLATEDTCP_COMPILER_IS_GNU_or_Clang
148
# define ONIXS_CONFLATEDTCP_ALIGNAS(X) __attribute__ ((__aligned__(X)))
149
# elif defined ONIXS_CONFLATEDTCP_COMPILER_IS_MSVC
150
# define ONIXS_CONFLATEDTCP_ALIGNAS(X) __declspec(align(X))
151
# else
152
# define ONIXS_CONFLATEDTCP_ALIGNAS(X)
153
# endif
154
155
#endif
156
157
#if defined NDEBUG
158
#define ONIXS_CONFLATEDTCP_ASSERT(CHECK) static_cast<void>((CHECK))
159
#else
160
#if defined (ONIXS_CONFLATEDTCP_CXX11)
161
# define ONIXS_CONFLATEDTCP_ASSERT(CHECK) ((CHECK) ? void(0) : []() {assert(!#CHECK);}())
162
# else
163
# define ONIXS_CONFLATEDTCP_ASSERT(CHECK) (assert((CHECK)))
164
# endif
165
#endif
166
167
#if defined (ONIXS_CONFLATEDTCP_CXX11)
168
# define ONIXS_CONFLATEDTCP_HAS_TYPE_TRAITS
169
#endif
170
171
#define ONIXS_CONFLATEDTCP_HARDWARE_DESTRUCTIVE_INTERFACE_SIZE (64)
172
173
#else //#if !(defined(ONIXS_DOXYGEN) && ONIXS_DOXYGEN)
174
175
#define ONIXS_CONFLATEDTCP_EXPORTED
176
#define ONIXS_CONFLATEDTCP_NOTHROW noexcept
177
#define ONIXS_CONFLATEDTCP_EXPLICIT explicit
178
#define ONIXS_CONFLATEDTCP_CONST_OR_CONSTEXPR constexpr
179
#define ONIXS_CONFLATEDTCP_CONSTEXPR constexpr
180
#define ONIXS_CONFLATEDTCP_OVERRIDE override
181
#define ONIXS_CONFLATEDTCP_FINAL final
182
#define ONIXS_CONFLATEDTCP_NULLPTR nullptr
183
184
#define ONIXS_CONFLATEDTCP_NORETURN
185
#define ONIXS_CONFLATEDTCP_NODISCARD
186
187
#define ONIXS_CONFLATEDTCP_HOTPATH
188
#define ONIXS_CONFLATEDTCP_COLDPATH
189
#define ONIXS_CONFLATEDTCP_PURE
190
191
#define ONIXS_CONFLATEDTCP_HAS_TYPE_TRAITS
192
193
#define ONIXS_CONFLATEDTCP_HAS_GATEWAY_EMULATOR
194
195
#define ONIXS_CONFLATEDTCP_CXX11
196
#define ONIXS_CONFLATEDTCP_CXX14
197
#define ONIXS_CONFLATEDTCP_CXX17
198
#define ONIXS_CONFLATEDTCP_CXX20
199
200
201
#define ONIXS_CONFLATEDTCP_UNUSED
202
#define ONIXS_CONFLATEDTCP_DEFAULT =default
203
204
#define ONIXS_CONFLATEDTCP_GCC44_SPURIOUS_WARNING_TURNAROUND
205
206
#define ONIXS_CONFLATEDTCP_HAS_GATEWAY_EMULATOR
207
208
#endif
CompilerDetection.h