Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
experimental_api.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2024, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
5#pragma once
6
29// Check if user has explicitly opted in to experimental APIs
30#ifndef NETWORK_USE_EXPERIMENTAL
31
32#if defined(__GNUC__) || defined(__clang__)
33#define NETWORK_EXPERIMENTAL_STATIC_ASSERT_MSG \
34 "This is an experimental API. Define NETWORK_USE_EXPERIMENTAL before including this header. " \
35 "Example: #define NETWORK_USE_EXPERIMENTAL"
36#else
37#define NETWORK_EXPERIMENTAL_STATIC_ASSERT_MSG \
38 "Experimental API - define NETWORK_USE_EXPERIMENTAL to use"
39#endif
40
48#define NETWORK_REQUIRE_EXPERIMENTAL \
49 static_assert(false, NETWORK_EXPERIMENTAL_STATIC_ASSERT_MSG)
50
51#else // NETWORK_USE_EXPERIMENTAL is defined
52
53#define NETWORK_REQUIRE_EXPERIMENTAL // No-op when opted in
54
55#endif // NETWORK_USE_EXPERIMENTAL
56
71#if defined(__cplusplus) && __cplusplus >= 201402L
72#define NETWORK_EXPERIMENTAL_API \
73 [[deprecated("Experimental API - may change between minor versions without notice")]]
74#else
75#define NETWORK_EXPERIMENTAL_API
76#endif
77
82#if defined(__GNUC__) || defined(__clang__)
83#define NETWORK_EXPERIMENTAL_WARNING(msg) _Pragma(#msg)
84#elif defined(_MSC_VER)
85#define NETWORK_EXPERIMENTAL_WARNING(msg) __pragma(message(msg))
86#else
87#define NETWORK_EXPERIMENTAL_WARNING(msg)
88#endif
89
91{
108} // namespace kcenon::network::experimental