Sen API
Sen Libraries
Toggle main menu visibility
Loading...
Searching...
No Matches
compiler_macros.h
Go to the documentation of this file.
1
// === compiler_macros.h ===============================================================================================
2
// Sen Infrastructure
3
// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4
// See the LICENSE.txt file for more information.
5
// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6
// =====================================================================================================================
7
8
#ifndef SEN_CORE_BASE_COMPILER_MACROS_H
9
#define SEN_CORE_BASE_COMPILER_MACROS_H
10
13
14
//--------------------------------------------------------------------------------------------------------------
15
// SEN_STRINGIFY
16
//--------------------------------------------------------------------------------------------------------------
17
18
#if defined(SEN_STRINGIFY_EX)
19
# undef SEN_STRINGIFY_EX
20
#endif
21
#define SEN_STRINGIFY_EX(x) #x
// NOLINT
22
23
#if defined(SEN_STRINGIFY)
24
# undef SEN_STRINGIFY
25
#endif
26
#define SEN_STRINGIFY(x) SEN_STRINGIFY_EX(x)
// NOLINT
27
28
//--------------------------------------------------------------------------------------------------------------
29
// SEN_CONCAT
30
//--------------------------------------------------------------------------------------------------------------
31
32
#if defined(SEN_CONCAT_EX)
33
# undef SEN_CONCAT_EX
34
#endif
35
#define SEN_CONCAT_EX(a, b) a##b
// NOLINT
36
37
#if defined(SEN_CONCAT)
38
# undef SEN_CONCAT
39
#endif
40
#define SEN_CONCAT(a, b) SEN_CONCAT_EX(a, b)
// NOLINT
41
42
//--------------------------------------------------------------------------------------------------------------
43
// SEN_VERSION_ENCODE
44
//--------------------------------------------------------------------------------------------------------------
45
46
#if defined(SEN_VERSION_ENCODE)
47
# undef SEN_VERSION_ENCODE
48
#endif
49
#define SEN_VERSION_ENCODE(major, minor, revision) (((major) * 1000000) + ((minor) * 1000) + (revision))
// NOLINT
50
51
//--------------------------------------------------------------------------------------------------------------
52
// SEN_VERSION_DECODE_MAJOR
53
//--------------------------------------------------------------------------------------------------------------
54
55
#if defined(SEN_VERSION_DECODE_MAJOR)
56
# undef SEN_VERSION_DECODE_MAJOR
57
#endif
58
#define SEN_VERSION_DECODE_MAJOR(version) ((version) / 1000000)
// NOLINT
59
60
//--------------------------------------------------------------------------------------------------------------
61
// SEN_VERSION_DECODE_MINOR
62
//--------------------------------------------------------------------------------------------------------------
63
64
#if defined(SEN_VERSION_DECODE_MINOR)
65
# undef SEN_VERSION_DECODE_MINOR
66
#endif
67
#define SEN_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000)
// NOLINT
68
69
//--------------------------------------------------------------------------------------------------------------
70
// SEN_VERSION_DECODE_REVISION
71
//--------------------------------------------------------------------------------------------------------------
72
73
#if defined(SEN_VERSION_DECODE_REVISION)
74
# undef SEN_VERSION_DECODE_REVISION
75
#endif
76
#define SEN_VERSION_DECODE_REVISION(version) ((version) % 1000)
// NOLINT
77
78
//--------------------------------------------------------------------------------------------------------------
79
// SEN_MSVC_VERSION, SEN_MSVC_VERSION_CHECK
80
//--------------------------------------------------------------------------------------------------------------
81
82
#if defined(SEN_MSVC_VERSION)
83
# undef SEN_MSVC_VERSION
84
#endif
85
#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL)
86
// NOLINTNEXTLINE
87
# define SEN_MSVC_VERSION \
88
SEN_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100)
89
#elif defined(_MSC_FULL_VER) && !defined(__ICL)
90
// NOLINTNEXTLINE
91
# define SEN_MSVC_VERSION \
92
SEN_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10)
93
#elif defined(_MSC_VER) && !defined(__ICL)
94
# define SEN_MSVC_VERSION SEN_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0)
// NOLINT
95
#endif
96
97
#if defined(SEN_MSVC_VERSION_CHECK)
98
# undef SEN_MSVC_VERSION_CHECK
99
#endif
100
#if !defined(SEN_MSVC_VERSION)
101
# define SEN_MSVC_VERSION_CHECK(major, minor, patch) (0)
// NOLINT
102
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
103
// NOLINTNEXTLINE
104
# define SEN_MSVC_VERSION_CHECK(major, minor, patch) \
105
(_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))
106
#elif defined(_MSC_VER) && (_MSC_VER >= 1200)
107
// NOLINTNEXTLINE
108
# define SEN_MSVC_VERSION_CHECK(major, minor, patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))
109
#else
110
# define SEN_MSVC_VERSION_CHECK(major, minor, patch) (_MSC_VER >= ((major * 100) + (minor)))
// NOLINT
111
#endif
112
113
//--------------------------------------------------------------------------------------------------------------
114
// SEN_GCC_VERSION, SEN_GCC_VERSION_CHECK
115
//--------------------------------------------------------------------------------------------------------------
116
117
#if defined(SEN_GNUC_VERSION)
118
# undef SEN_GNUC_VERSION
119
#endif
120
#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
121
# define SEN_GNUC_VERSION SEN_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
// NOLINT
122
#elif defined(__GNUC__)
123
# define SEN_GNUC_VERSION SEN_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0)
// NOLINT
124
#endif
125
126
#if defined(SEN_GCC_VERSION)
127
# undef SEN_GCC_VERSION
128
#endif
129
#if defined(SEN_GNUC_VERSION) && !defined(__clang__)
130
# define SEN_GCC_VERSION SEN_GNUC_VERSION
// NOLINT
131
#endif
132
133
#if defined(SEN_GCC_VERSION_CHECK)
134
# undef SEN_GCC_VERSION_CHECK
135
#endif
136
#if defined(SEN_GCC_VERSION)
137
// NOLINTNEXTLINE
138
# define SEN_GCC_VERSION_CHECK(major, minor, patch) (SEN_GCC_VERSION >= SEN_VERSION_ENCODE(major, minor, patch))
139
// NOLINTNEXTLINE
140
# define SEN_GCC_VERSION_CHECK_SMALLER(major, minor, patch) (SEN_GCC_VERSION < SEN_VERSION_ENCODE(major, minor, patch))
141
#else
142
// NOLINTNEXTLINE
143
# define SEN_GCC_VERSION_CHECK(major, minor, patch) (0)
144
// NOLINTNEXTLINE
145
# define SEN_GCC_VERSION_CHECK_SMALLER(major, minor, patch) (0)
146
#endif
147
148
//--------------------------------------------------------------------------------------------------------------
149
// SEN_HAS_ATTRIBUTE
150
//--------------------------------------------------------------------------------------------------------------
151
152
#if defined(SEN_HAS_ATTRIBUTE)
153
# undef SEN_HAS_ATTRIBUTE
154
#endif
155
#if defined(__has_attribute)
156
# define SEN_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)
// NOLINT
157
#else
158
# define SEN_HAS_ATTRIBUTE(attribute) (0)
// NOLINT
159
#endif
160
161
//--------------------------------------------------------------------------------------------------------------
162
// SEN_HAS_CPP_ATTRIBUTE
163
//--------------------------------------------------------------------------------------------------------------
164
165
#if defined(SEN_HAS_CPP_ATTRIBUTE)
166
# undef SEN_HAS_CPP_ATTRIBUTE
167
#endif
168
#if defined(__has_cpp_attribute) && defined(__cplusplus)
169
# define SEN_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
// NOLINT
170
#else
171
# define SEN_HAS_CPP_ATTRIBUTE(attribute) (0)
// NOLINT
172
#endif
173
174
//--------------------------------------------------------------------------------------------------------------
175
// SEN_HAS_BUILTIN
176
//--------------------------------------------------------------------------------------------------------------
177
178
#if defined(SEN_HAS_BUILTIN)
179
# undef SEN_HAS_BUILTIN
180
#endif
181
#if defined(__has_builtin)
182
# define SEN_HAS_BUILTIN(builtin) __has_builtin(builtin)
// NOLINT
183
#else
184
# define SEN_HAS_BUILTIN(builtin) (0)
// NOLINT
185
#endif
186
187
//--------------------------------------------------------------------------------------------------------------
188
// SEN_HAS_EXTENSION
189
//--------------------------------------------------------------------------------------------------------------
190
191
#if defined(SEN_HAS_EXTENSION)
192
# undef SEN_HAS_EXTENSION
193
#endif
194
#if defined(__has_extension)
195
# define SEN_HAS_EXTENSION(extension) __has_extension(extension)
// NOLINT
196
#else
197
# define SEN_HAS_EXTENSION(extension) (0)
// NOLINT
198
#endif
199
200
//--------------------------------------------------------------------------------------------------------------
201
// SEN_DEPRECATED, SEN_DEPRECATED_FOR
202
//--------------------------------------------------------------------------------------------------------------
203
204
// clang-format off
205
206
#if defined(SEN_DEPRECATED)
207
# undef SEN_DEPRECATED
208
#endif
209
#if defined(SEN_DEPRECATED_FOR)
210
# undef SEN_DEPRECATED_FOR
211
#endif
212
#if SEN_MSVC_VERSION_CHECK(14, 0, 0)
213
# define SEN_DEPRECATED(since) __declspec(deprecated("Since " # since))
// NOLINT
214
// NOLINTNEXTLINE
215
# define SEN_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " # since "; use " # replacement))
216
#elif SEN_HAS_EXTENSION(attribute_deprecated_with_message) || SEN_GCC_VERSION_CHECK(4, 5, 0)
217
# define SEN_DEPRECATED(since) __attribute__((__deprecated__("Since " # since)))
// NOLINT
218
// NOLINTNEXTLINE
219
# define SEN_DEPRECATED_FOR(since, replacement) \
220
__attribute__((__deprecated__("Since " #since "; use " #replacement)))
// NOLINT
221
#elif defined(__cplusplus) && (__cplusplus >= 201402L)
222
# define SEN_DEPRECATED(since) [[deprecated("Since " # since)]]
// NOLINT
223
# define SEN_DEPRECATED_FOR(since, replacement) [[deprecated("Since " # since "; use " # replacement)]]
// NOLINT
224
#elif SEN_HAS_ATTRIBUTE(deprecated) || SEN_GCC_VERSION_CHECK(3, 1, 0)
225
# define SEN_DEPRECATED(since) __attribute__((__deprecated__))
// NOLINT
226
# define SEN_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__))
// NOLINT
227
#elif SEN_MSVC_VERSION_CHECK(13, 10, 0)
228
# define SEN_DEPRECATED(since) __declspec(deprecated)
// NOLINT
229
# define SEN_DEPRECATED_FOR(since, replacement) __declspec(deprecated)
// NOLINT
230
#else
231
# define SEN_DEPRECATED(since)
// NOLINT
232
# define SEN_DEPRECATED_FOR(since, replacement)
// NOLINT
233
#endif
234
235
//--------------------------------------------------------------------------------------------------------------
236
// SEN_UNAVAILABLE
237
//--------------------------------------------------------------------------------------------------------------
238
239
#if defined(SEN_UNAVAILABLE)
240
# undef SEN_UNAVAILABLE
241
#endif
242
#if SEN_HAS_ATTRIBUTE(warning) || SEN_GCC_VERSION_CHECK(4, 3, 0)
243
// NOLINTNEXTLINE
244
# define SEN_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " # available_since)))
245
#else
246
# define SEN_UNAVAILABLE(available_since)
// NOLINT
247
#endif
248
249
// clang-format on
250
251
//--------------------------------------------------------------------------------------------------------------
252
// SEN_PRINTF_FORMAT
253
//--------------------------------------------------------------------------------------------------------------
254
255
#if defined(SEN_PRINTF_FORMAT)
256
# undef SEN_PRINTF_FORMAT
257
#endif
258
#if SEN_HAS_ATTRIBUTE(format) || SEN_GCC_VERSION_CHECK(3, 1, 0)
259
// NOLINTNEXTLINE
260
# define SEN_PRINTF_FORMAT(string_idx, first_to_check) \
261
__attribute__((__format__(__printf__, string_idx, first_to_check)))
262
#else
263
# define SEN_PRINTF_FORMAT(string_idx, first_to_check)
// NOLINT
264
#endif
265
266
//--------------------------------------------------------------------------------------------------------------
267
// SEN_ALWAYS_INLINE
268
//--------------------------------------------------------------------------------------------------------------
269
270
#if defined(SEN_ALWAYS_INLINE)
271
# undef SEN_ALWAYS_INLINE
272
#endif
273
#if SEN_HAS_ATTRIBUTE(always_inline) || SEN_GCC_VERSION_CHECK(4, 0, 0)
274
# define SEN_ALWAYS_INLINE __attribute__((__always_inline__)) inline
// NOLINT
275
#elif SEN_MSVC_VERSION_CHECK(12, 0, 0)
276
# define SEN_ALWAYS_INLINE __forceinline
// NOLINT
277
#else
278
# define SEN_ALWAYS_INLINE inline
// NOLINT
279
#endif
280
281
//--------------------------------------------------------------------------------------------------------------
282
// SEN_PREDICT, SEN_LIKELY, SEN_UNLIKELY, SEN_UNPREDICTABLE, SEN_PREDICT_TRUE, SEN_PREDICT_FALSE
283
//--------------------------------------------------------------------------------------------------------------
284
285
#if defined(SEN_PREDICT)
286
# undef SEN_PREDICT
287
#endif
288
#if defined(SEN_LIKELY)
289
# undef SEN_LIKELY
290
#endif
291
#if defined(SEN_UNLIKELY)
292
# undef SEN_UNLIKELY
293
#endif
294
#if defined(SEN_UNPREDICTABLE)
295
# undef SEN_UNPREDICTABLE
296
#endif
297
#if SEN_HAS_BUILTIN(__builtin_unpredictable)
298
# define SEN_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
// NOLINT
299
#endif
300
#if SEN_HAS_BUILTIN(__builtin_expect_with_probability) || SEN_GCC_VERSION_CHECK(9, 0, 0)
301
302
// NOLINTNEXTLINE
303
# define SEN_PREDICT(expr, value, probability) __builtin_expect_with_probability((expr), (value), (probability))
304
// NOLINTNEXTLINE
305
# define SEN_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, (probability))
306
// NOLINTNEXTLINE
307
# define SEN_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, (probability))
308
309
# define SEN_LIKELY(expr) __builtin_expect(!!(expr), 1)
// NOLINT
310
# define SEN_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
// NOLINT
311
#elif SEN_HAS_BUILTIN(__builtin_expect) || SEN_GCC_VERSION_CHECK(3, 0, 0)
312
// NOLINTNEXTLINE
313
# define SEN_PREDICT(expr, expected, probability) \
314
(((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (static_cast<void>(expected), (expr)))
315
// NOLINTNEXTLINE
316
# define SEN_PREDICT_TRUE(expr, probability) \
317
(__extension__({ \
318
double senProbability = (probability); \
319
((senProbability >= 0.9) ? __builtin_expect(!!(expr), 1) \
320
: ((senProbability <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \
321
}))
322
// NOLINTNEXTLINE
323
# define SEN_PREDICT_FALSE(expr, probability) \
324
(__extension__({ \
325
double senProbability = (probability); \
326
((senProbability >= 0.9) ? __builtin_expect(!!(expr), 0) \
327
: ((senProbability <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \
328
}))
329
330
# define SEN_LIKELY(expr) __builtin_expect(!!(expr), 1)
// NOLINT
331
# define SEN_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
// NOLINT
332
#else
333
# define SEN_PREDICT(expr, expected, probability) (static_cast<void>(expected), (expr))
// NOLINT
334
# define SEN_PREDICT_TRUE(expr, probability) (!!(expr))
// NOLINT
335
# define SEN_PREDICT_FALSE(expr, probability) (!!(expr))
// NOLINT
336
# define SEN_LIKELY(expr) (!!(expr))
// NOLINT
337
# define SEN_UNLIKELY(expr) (!!(expr))
// NOLINT
338
#endif
339
#if !defined(SEN_UNPREDICTABLE)
340
# define SEN_UNPREDICTABLE(expr) SEN_PREDICT(expr, 1, 0.5)
// NOLINT
341
#endif
342
343
//--------------------------------------------------------------------------------------------------------------
344
// SEN_EXPORT, SEN_IMPORT, SEN_PRIVATE
345
//--------------------------------------------------------------------------------------------------------------
346
347
#if defined(SEN_EXPORT)
348
# undef SEN_EXPORT
349
#endif
350
#if defined(SEN_IMPORT)
351
# undef SEN_IMPORT
352
#endif
353
#if defined(_WIN32) || defined(__CYGWIN__)
354
# define SEN_PRIVATE
// NOLINT
355
# define SEN_EXPORT __declspec(dllexport)
// NOLINT
356
# define SEN_MAYBE_EXPORT(flag) SEN_MAYBE_EXPORT_##flag
357
# define SEN_MAYBE_EXPORT_true SEN_EXPORT
// NOLINT
358
# define SEN_MAYBE_EXPORT_false
// NOLINT
359
# define SEN_IMPORT __declspec(dllimport)
// NOLINT
360
#else
361
# if SEN_HAS_ATTRIBUTE(visibility) || SEN_GCC_VERSION_CHECK(3, 3, 0)
362
# define SEN_PRIVATE __attribute__((__visibility__("hidden")))
// NOLINT
363
# define SEN_EXPORT __attribute__((__visibility__("default")))
// NOLINT
364
# define SEN_MAYBE_EXPORT(flag) SEN_MAYBE_EXPORT_##flag
365
# define SEN_MAYBE_EXPORT_true SEN_EXPORT
// NOLINT
366
# define SEN_MAYBE_EXPORT_false
// NOLINT
367
# else
368
# define SEN_PRIVATE
// NOLINT
369
# define SEN_EXPORT
// NOLINT
370
# endif
371
# define SEN_IMPORT
// NOLINT
372
#endif
373
374
//--------------------------------------------------------------------------------------------------------------
375
// SEN_FALL_THROUGH
376
//--------------------------------------------------------------------------------------------------------------
377
378
#if defined(SEN_FALL_THROUGH)
379
# undef SEN_FALL_THROUGH
380
#endif
381
#if SEN_HAS_ATTRIBUTE(fallthrough) || SEN_GCC_VERSION_CHECK(7, 0, 0)
382
# define SEN_FALL_THROUGH __attribute__((__fallthrough__))
// NOLINT
383
#elif SEN_HAS_CPP_ATTRIBUTE(fallthrough)
384
# define SEN_FALL_THROUGH [[fallthrough]]
// NOLINT
385
#elif defined(__fallthrough)
/* SAL */
386
# define SEN_FALL_THROUGH __fallthrough
// NOLINT
387
#else
388
# define SEN_FALL_THROUGH
// NOLINT
389
#endif
390
391
//--------------------------------------------------------------------------------------------------------------
392
// SEN_UNREACHABLE
393
//--------------------------------------------------------------------------------------------------------------
394
395
#if defined(SEN_UNREACHABLE)
396
# undef SEN_UNREACHABLE
397
#endif
398
#if defined(SEN_ASSUME)
399
# undef SEN_ASSUME
400
#endif
401
#if SEN_MSVC_VERSION_CHECK(13, 10, 0)
402
# define SEN_ASSUME(expr) __assume(expr)
// NOLINT
403
#elif SEN_HAS_BUILTIN(__builtin_assume)
404
# define SEN_ASSUME(expr) __builtin_assume(expr)
// NOLINT
405
#endif
406
#if SEN_HAS_BUILTIN(__builtin_unreachable) || SEN_GCC_VERSION_CHECK(4, 5, 0)
407
# define SEN_UNREACHABLE() __builtin_unreachable()
// NOLINT
408
#elif defined(SEN_ASSUME)
409
# define SEN_UNREACHABLE() SEN_ASSUME(0)
// NOLINT
410
#endif
411
#if !defined(SEN_ASSUME)
412
# if defined(SEN_UNREACHABLE)
413
# define SEN_ASSUME(expr) static_cast<void>((expr) ? 1 : (SEN_UNREACHABLE(), 1))
// NOLINT
414
# else
415
# define SEN_ASSUME(expr) static_cast<void>(expr)
// NOLINT
416
# endif
417
#endif
418
419
#if !defined(SEN_UNREACHABLE)
420
# define SEN_UNREACHABLE() SEN_ASSUME(0)
// NOLINT
421
#endif
422
423
//--------------------------------------------------------------------------------------------------------------
424
// SEN_RETURNS_NON_NULL
425
//--------------------------------------------------------------------------------------------------------------
426
427
#if defined(SEN_RETURNS_NON_NULL)
428
# undef SEN_RETURNS_NON_NULL
429
#endif
430
#if SEN_HAS_ATTRIBUTE(returns_nonnull) || SEN_GCC_VERSION_CHECK(4, 9, 0)
431
# define SEN_RETURNS_NON_NULL __attribute__((__returns_nonnull__))
// NOLINT
432
#elif defined(_Ret_notnull_)
433
# define SEN_RETURNS_NON_NULL _Ret_notnull_
// NOLINT
434
#else
435
# define SEN_RETURNS_NON_NULL
// NOLINT
436
#endif
437
438
//--------------------------------------------------------------------------------------------------------------
439
// SEN_COPY_CONSTRUCT, SEN_COPY_ASSIGN, SEN_MOVE_CONSTRUCT, SEN_MOVE_ASSIGN
440
//--------------------------------------------------------------------------------------------------------------
441
442
#define SEN_COPY_CONSTRUCT(classname) classname(const classname& other)
// NOLINT
443
#define SEN_COPY_ASSIGN(classname) classname& operator=(const classname& other)
// NOLINT
444
#define SEN_MOVE_CONSTRUCT(classname) classname(classname&& other) noexcept
// NOLINT
445
#define SEN_MOVE_ASSIGN(classname) classname& operator=(classname&& other) noexcept
// NOLINT
446
447
//--------------------------------------------------------------------------------------------------------------
448
// SEN_NOCOPY_NOMOVE
449
//--------------------------------------------------------------------------------------------------------------
450
451
// NOLINTNEXTLINE
452
#define SEN_NOCOPY_NOMOVE(classname) \
453
SEN_COPY_CONSTRUCT(classname) = delete; \
454
SEN_COPY_ASSIGN(classname) = delete; \
455
SEN_MOVE_CONSTRUCT(classname) = delete; \
456
SEN_MOVE_ASSIGN(classname) = delete;
457
458
//--------------------------------------------------------------------------------------------------------------
459
// SEN_MOVE_ONLY
460
//--------------------------------------------------------------------------------------------------------------
461
462
// NOLINTNEXTLINE
463
#define SEN_MOVE_ONLY(classname) \
464
public: \
465
SEN_COPY_CONSTRUCT(classname) = delete; \
466
SEN_COPY_ASSIGN(classname) = delete; \
467
SEN_MOVE_CONSTRUCT(classname) = default; \
468
SEN_MOVE_ASSIGN(classname) = default; \
469
\
470
private:
471
472
//--------------------------------------------------------------------------------------------------------------
473
// SEN_COPY_MOVE
474
//--------------------------------------------------------------------------------------------------------------
475
476
// NOLINTNEXTLINE
477
#define SEN_COPY_MOVE(classname) \
478
public: \
479
SEN_COPY_CONSTRUCT(classname) = default; \
480
SEN_COPY_ASSIGN(classname) = default; \
481
SEN_MOVE_CONSTRUCT(classname) = default; \
482
SEN_MOVE_ASSIGN(classname) = default; \
483
\
484
private:
485
486
//--------------------------------------------------------------------------------------------------------------
487
// SEN_PRIVATE_TAG
488
//--------------------------------------------------------------------------------------------------------------
489
490
#define SEN_PRIVATE_TAG \
491
private: \
492
struct Private \
493
{ \
494
explicit Private() = default; \
495
};
496
498
499
#endif
// SEN_CORE_BASE_COMPILER_MACROS_H
libs
core
include
sen
core
base
compiler_macros.h
Generated by
1.17.0