2
3
4
5
6
7
8
9
10
11
12
13
14
15
17#ifndef IPADDRESS_CONFIG_HPP
18#define IPADDRESS_CONFIG_HPP
20#ifndef IPADDRESS_MODULE
34# include <type_traits>
37#ifndef IPADDRESS_NAMESPACE
38# define IPADDRESS_NAMESPACE ipaddress
41#ifndef IPADDRESS_MODULE
42# define IPADDRESS_EXPORT
44# define IPADDRESS_EXPORT export
47#if defined(_MSVC_LANG)
48# define IPADDRESS_CPLUSPLUS _MSVC_LANG
50# define IPADDRESS_CPLUSPLUS __cplusplus
54# define IPADDRESS_CPP_VERSION 20
56# define IPADDRESS_CPP_VERSION 17
58# define IPADDRESS_CPP_VERSION 14
59#elif 199711L
< IPADDRESS_CPLUSPLUS
60# define IPADDRESS_CPP_VERSION 11
62# error ipaddress needs at least C++ standard version 11
66# if __cpp_constexpr
>= 201304L
67# define IPADDRESS_CONSTEXPR constexpr
69# define IPADDRESS_CONSTEXPR
71# if __cpp_constexpr
>= 201603L
72# define IPADDRESS_CONSTEXPR_17 constexpr
74# define IPADDRESS_CONSTEXPR_17
77# error ipaddress needs at least C++ standard version 11
80#if defined(__cpp_consteval) && __cpp_consteval >= 201811L
81# define IPADDRESS_CONSTEVAL consteval
83# define IPADDRESS_CONSTEVAL IPADDRESS_CONSTEXPR
86#if defined(_MSC_VER) && (_MSC_VER <= 1800
)
87# define IPADDRESS_NOEXCEPT
89# define IPADDRESS_NOEXCEPT noexcept
90# ifdef IPADDRESS_NO_EXCEPTIONS
91# define IPADDRESS_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept
93# define IPADDRESS_NOEXCEPT_WHEN_NO_EXCEPTIONS
97#if (IPADDRESS_CPP_VERSION
>= 17
) && !defined(IPADDRESS_NO_NODISCARD)
98# define IPADDRESS_NODISCARD [[nodiscard]]
99# ifdef IPADDRESS_NO_EXCEPTIONS
100# define IPADDRESS_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]]
102# define IPADDRESS_NODISCARD_WHEN_NO_EXCEPTIONS
105# define IPADDRESS_NODISCARD
106# define IPADDRESS_NODISCARD_WHEN_NO_EXCEPTIONS
110# define IPADDRESS_FORCE_INLINE __forceinline
112# define IPADDRESS_FORCE_INLINE inline __attribute__((always_inline))
115#if !defined(IPADDRESS_NO_SPACESHIP_OPERATOR) && defined(__has_include
)
116# if (__cpp_lib_three_way_comparison >= 201907L
) && __has_include
(<compare>)
117# define IPADDRESS_HAS_SPACESHIP_OPERATOR
118# ifndef IPADDRESS_MODULE
124#if defined(__cpp_nontype_template_parameter_class)
125# define IPADDRESS_NONTYPE_TEMPLATE_PARAMETER
126#elif defined(__cpp_nontype_template_args)
127# if __cpp_nontype_template_args >= 201911L
128# define IPADDRESS_NONTYPE_TEMPLATE_PARAMETER
129# elif __cpp_nontype_template_args >= 201411L
&& IPADDRESS_CPP_VERSION >= 20
130# if defined(__apple_build_version__)
131# if defined(__clang_major__) && __clang_major__ >= 13
132# define IPADDRESS_NONTYPE_TEMPLATE_PARAMETER
134# elif defined(__clang_major__) && __clang_major__ >= 12
135# define IPADDRESS_NONTYPE_TEMPLATE_PARAMETER
140#if __cpp_lib_is_constant_evaluated >= 201811L
141# define IPADDRESS_IS_CONST_EVALUATED(x) std::is_constant_evaluated()
143# define IPADDRESS_IS_CONST_EVALUATED(x) __builtin_is_constant_evaluated()
145# define IPADDRESS_IS_CONST_EVALUATED(x) __builtin_constant_p(x)
147# define IPADDRESS_IS_CONST_EVALUATED(x) false
150#if IPADDRESS_CPP_VERSION
>= 17
&& !defined(IPADDRESS_MODULE)
151# include <string_view>
154#if defined(IPADDRESS_NO_IPV6_SCOPE)
155# undef IPADDRESS_IPV6_SCOPE_MAX_LENGTH
156# define IPADDRESS_IPV6_SCOPE_MAX_LENGTH 0
157#elif defined(IPADDRESS_IPV6_SCOPE_MAX_LENGTH)
158# if IPADDRESS_IPV6_SCOPE_MAX_LENGTH < 0
159# undef IPADDRESS_IPV6_SCOPE_MAX_LENGTH
160# define IPADDRESS_IPV6_SCOPE_MAX_LENGTH 0
161# elif IPADDRESS_IPV6_SCOPE_MAX_LENGTH > 64
162# undef IPADDRESS_IPV6_SCOPE_MAX_LENGTH
163# define IPADDRESS_IPV6_SCOPE_MAX_LENGTH 64
166# define IPADDRESS_IPV6_SCOPE_MAX_LENGTH 16
#define IPADDRESS_CPLUSPLUS
Definition config.hpp:50