Go to the documentation of this file.
13 #ifndef STD_EXPLICIT_DECLARE_H
14 #define STD_EXPLICIT_DECLARE_H
24 # if defined(_MSC_VER) && _MSC_VER >= 1700
25 # define PARAM_IN _In_
32 # if defined(_MSC_VER) && _MSC_VER >= 1700
33 # define PARAM_OUT _Out_
40 # if defined(_MSC_VER) && _MSC_VER >= 1700
41 # define PARAM_INOUT _Inout_
58 #if defined(__cplusplus) && __cplusplus >= 201402L
59 # define EXPLICIT_DEPRECATED_ATTR [[deprecated]]
60 #elif defined(__clang__)
61 # define EXPLICIT_DEPRECATED_ATTR __attribute__((deprecated))
62 #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
63 # define EXPLICIT_DEPRECATED_ATTR __attribute__((deprecated))
64 #elif defined(_MSC_VER) && _MSC_VER >= 1400
65 # if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
66 # define EXPLICIT_DEPRECATED_ATTR [[deprecated]]
68 # define EXPLICIT_DEPRECATED_ATTR __declspec(deprecated)
71 # define EXPLICIT_DEPRECATED_ATTR
74 #if defined(__cplusplus) && __cplusplus >= 201402L
75 # define EXPLICIT_DEPRECATED_MSG(msg) [[deprecated(msg)]]
76 #elif defined(__clang__)
77 # define EXPLICIT_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
78 #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
79 # define EXPLICIT_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
80 #elif defined(_MSC_VER) && _MSC_VER >= 1400
81 # if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
82 # define EXPLICIT_DEPRECATED_MSG(msg) [[deprecated(msg)]]
84 # define EXPLICIT_DEPRECATED_MSG(msg) __declspec(deprecated(msg))
87 # define EXPLICIT_DEPRECATED_MSG(msg)
97 #if defined(__cplusplus) && __cplusplus >= 201703L
98 # define EXPLICIT_NODISCARD_ATTR [[nodiscard]]
99 #elif defined(__clang__)
100 # define EXPLICIT_NODISCARD_ATTR __attribute__((warn_unused_result))
101 #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
102 # define EXPLICIT_NODISCARD_ATTR __attribute__((warn_unused_result))
103 #elif defined(_MSC_VER) && _MSC_VER >= 1700
104 # if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
105 # define EXPLICIT_NODISCARD_ATTR [[nodiscard]]
107 # define EXPLICIT_NODISCARD_ATTR _Check_return_
110 # define EXPLICIT_NODISCARD_ATTR
120 #if defined(__cplusplus) && __cplusplus >= 201703L
121 # define EXPLICIT_UNUSED_ATTR [[maybe_unused]]
122 #elif defined(__clang__)
123 # define EXPLICIT_UNUSED_ATTR __attribute__((unused))
124 #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
125 # define EXPLICIT_UNUSED_ATTR __attribute__((unused))
126 #elif defined(_MSC_VER) && _MSC_VER >= 1700
127 # if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
128 # define EXPLICIT_UNUSED_ATTR [[maybe_unused]]
130 # define EXPLICIT_UNUSED_ATTR
133 # define EXPLICIT_UNUSED_ATTR
144 #if defined(__cplusplus) && __cplusplus >= 201703L
145 # define EXPLICIT_FALLTHROUGH [[fallthrough]];
146 #elif defined(__clang__) && ((__clang_major__ * 100) + __clang_minor__) >= 309
147 # if defined(__apple_build_version__)
148 # define EXPLICIT_FALLTHROUGH
149 # elif defined(__has_warning) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
150 # define EXPLICIT_FALLTHROUGH [[clang::fallthrough]];
152 # define EXPLICIT_FALLTHROUGH
154 #elif defined(__GNUC__) && (__GNUC__ >= 7)
155 # define EXPLICIT_FALLTHROUGH [[gnu::fallthrough]];
156 #elif defined(_MSC_VER) && _MSC_VER >= 1700
157 # if _MSC_VER >= 1910 && defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
158 # define EXPLICIT_FALLTHROUGH [[fallthrough]];
160 # define EXPLICIT_FALLTHROUGH
163 # define EXPLICIT_FALLTHROUGH