Loading...
Searching...
No Matches
Go to the documentation of this file.
7# if __has_include(<version>)
10#elif defined(_MSC_VER) && \
11 ((defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
28#if defined(__cplusplus) && __cplusplus >= 201402L
29# define LIBCOPP_EXPLICIT_DEPRECATED_ATTR [[deprecated]]
30#elif defined(__clang__)
31# define LIBCOPP_EXPLICIT_DEPRECATED_ATTR __attribute__((deprecated))
32#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
33# define LIBCOPP_EXPLICIT_DEPRECATED_ATTR __attribute__((deprecated))
34#elif defined(_MSC_VER) && _MSC_VER >= 1400
35# if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
36# define LIBCOPP_EXPLICIT_DEPRECATED_ATTR [[deprecated]]
38# define LIBCOPP_EXPLICIT_DEPRECATED_ATTR __declspec(deprecated)
41# define LIBCOPP_EXPLICIT_DEPRECATED_ATTR
44#if defined(__cplusplus) && __cplusplus >= 201402L
45# define LIBCOPP_EXPLICIT_DEPRECATED_MSG(msg) [[deprecated(msg)]]
46#elif defined(__clang__)
47# define LIBCOPP_EXPLICIT_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
48#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
49# define LIBCOPP_EXPLICIT_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
50#elif defined(_MSC_VER) && _MSC_VER >= 1400
51# if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
52# define LIBCOPP_EXPLICIT_DEPRECATED_MSG(msg) [[deprecated(msg)]]
54# define LIBCOPP_EXPLICIT_DEPRECATED_MSG(msg) __declspec(deprecated(msg))
57# define LIBCOPP_EXPLICIT_DEPRECATED_MSG(msg)
67#if defined(__cplusplus) && __cplusplus >= 201703L
68# define LIBCOPP_EXPLICIT_NODISCARD_ATTR [[nodiscard]]
69#elif defined(__clang__)
70# define LIBCOPP_EXPLICIT_NODISCARD_ATTR __attribute__((warn_unused_result))
71#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
72# define LIBCOPP_EXPLICIT_NODISCARD_ATTR __attribute__((warn_unused_result))
73#elif defined(_MSC_VER) && _MSC_VER >= 1700
74# if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
75# define LIBCOPP_EXPLICIT_NODISCARD_ATTR [[nodiscard]]
77# define LIBCOPP_EXPLICIT_NODISCARD_ATTR _Check_return_
80# define LIBCOPP_EXPLICIT_NODISCARD_ATTR
90#if defined(__cplusplus) && __cplusplus >= 201703L
91# define LIBCOPP_EXPLICIT_UNUSED_ATTR [[maybe_unused]]
92#elif defined(__clang__)
93# define LIBCOPP_EXPLICIT_UNUSED_ATTR __attribute__((unused))
94#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
95# define LIBCOPP_EXPLICIT_UNUSED_ATTR __attribute__((unused))
96#elif defined(_MSC_VER) && _MSC_VER >= 1700
97# if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
98# define LIBCOPP_EXPLICIT_UNUSED_ATTR [[maybe_unused]]
100# define LIBCOPP_EXPLICIT_UNUSED_ATTR
103# define LIBCOPP_EXPLICIT_UNUSED_ATTR
114#if defined(__cplusplus) && __cplusplus >= 201703L
115# define LIBCOPP_EXPLICIT_FALLTHROUGH [[fallthrough]];
116#elif defined(__clang__) && ((__clang_major__ * 100) + __clang_minor__) >= 309
117# if defined(__apple_build_version__)
118# define LIBCOPP_EXPLICIT_FALLTHROUGH
119# elif defined(__has_warning) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
120# define LIBCOPP_EXPLICIT_FALLTHROUGH [[clang::fallthrough]];
122# define LIBCOPP_EXPLICIT_FALLTHROUGH
124#elif defined(__GNUC__) && (__GNUC__ >= 7)
125# define LIBCOPP_EXPLICIT_FALLTHROUGH [[gnu::fallthrough]];
126#elif defined(_MSC_VER) && _MSC_VER >= 1700
127# if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
128# define LIBCOPP_EXPLICIT_FALLTHROUGH [[fallthrough]];
130# define LIBCOPP_EXPLICIT_FALLTHROUGH
133# define LIBCOPP_EXPLICIT_FALLTHROUGH
142#if defined(__clang__)
143# define LIBCOPP_EXPLICIT_MAY_ALIAS __attribute__((__may_alias__))
144#elif defined(__GNUC__) && (__GNUC__ >= 4)
145# define LIBCOPP_EXPLICIT_MAY_ALIAS __attribute__((__may_alias__))
147# define LIBCOPP_EXPLICIT_MAY_ALIAS
150#if !defined(LIBCOPP_EXPLICIT_NORETURN_ATTR) && defined(__has_cpp_attribute)
151# if __has_cpp_attribute(noreturn)
152# define LIBCOPP_EXPLICIT_NORETURN_ATTR [[noreturn]]
155#ifndef LIBCOPP_EXPLICIT_NORETURN_ATTR
156# define LIBCOPP_EXPLICIT_NORETURN_ATTR
159#ifndef LIBCOPP_EXPLICIT_UNREACHABLE
160# if defined(__cpp_lib_unreachable)
161# if __cpp_lib_unreachable
162# define LIBCOPP_EXPLICIT_UNREACHABLE() std::unreachable()
165# if !defined(LIBCOPP_EXPLICIT_UNREACHABLE) && defined(unreachable)
166# define LIBCOPP_EXPLICIT_UNREACHABLE() unreachable()
168# if !defined(LIBCOPP_EXPLICIT_UNREACHABLE)
171# if __has_builtin(__builtin_unreachable)
172# define LIBCOPP_EXPLICIT_UNREACHABLE() __builtin_unreachable()
175# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
176# define LIBCOPP_EXPLICIT_UNREACHABLE() __builtin_unreachable()
182#if !defined(LIBCOPP_EXPLICIT_UNREACHABLE)
183# if defined(_DEBUG) || !defined(NDEBUG)
184# define LIBCOPP_EXPLICIT_UNREACHABLE() std::abort()
186# define LIBCOPP_EXPLICIT_UNREACHABLE()