xref: /aosp_15_r20/external/vulkan-headers/include/vulkan/vulkan_hpp_macros.hpp (revision 902771965e4c6d39c75c62130a6a330c08b024db)
1 // Copyright 2015-2024 The Khronos Group Inc.
2 //
3 // SPDX-License-Identifier: Apache-2.0 OR MIT
4 //
5 
6 // This header is generated from the Khronos Vulkan XML API Registry.
7 
8 #ifndef VULKAN_HPP_MACROS_HPP
9 #define VULKAN_HPP_MACROS_HPP
10 
11 #if defined( _MSVC_LANG )
12 #  define VULKAN_HPP_CPLUSPLUS _MSVC_LANG
13 #else
14 #  define VULKAN_HPP_CPLUSPLUS __cplusplus
15 #endif
16 
17 #if 202002L < VULKAN_HPP_CPLUSPLUS
18 #  define VULKAN_HPP_CPP_VERSION 23
19 #elif 201703L < VULKAN_HPP_CPLUSPLUS
20 #  define VULKAN_HPP_CPP_VERSION 20
21 #elif 201402L < VULKAN_HPP_CPLUSPLUS
22 #  define VULKAN_HPP_CPP_VERSION 17
23 #elif 201103L < VULKAN_HPP_CPLUSPLUS
24 #  define VULKAN_HPP_CPP_VERSION 14
25 #elif 199711L < VULKAN_HPP_CPLUSPLUS
26 #  define VULKAN_HPP_CPP_VERSION 11
27 #else
28 #  error "vulkan.hpp needs at least c++ standard version 11"
29 #endif
30 
31 // include headers holding feature-test macros
32 #if 20 <= VULKAN_HPP_CPP_VERSION
33 #  include <version>
34 #else
35 #  include <ciso646>
36 #endif
37 
38 #if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
39 #  if !defined( VULKAN_HPP_NO_SMART_HANDLE )
40 #    define VULKAN_HPP_NO_SMART_HANDLE
41 #  endif
42 #endif
43 
44 #if defined( VULKAN_HPP_NO_CONSTRUCTORS )
45 #  if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS )
46 #    define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS
47 #  endif
48 #  if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS )
49 #    define VULKAN_HPP_NO_UNION_CONSTRUCTORS
50 #  endif
51 #endif
52 
53 #if defined( VULKAN_HPP_NO_SETTERS )
54 #  if !defined( VULKAN_HPP_NO_STRUCT_SETTERS )
55 #    define VULKAN_HPP_NO_STRUCT_SETTERS
56 #  endif
57 #  if !defined( VULKAN_HPP_NO_UNION_SETTERS )
58 #    define VULKAN_HPP_NO_UNION_SETTERS
59 #  endif
60 #endif
61 
62 #if !defined( VULKAN_HPP_ASSERT )
63 #  define VULKAN_HPP_ASSERT assert
64 #endif
65 
66 #if !defined( VULKAN_HPP_ASSERT_ON_RESULT )
67 #  define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT
68 #endif
69 
70 #if !defined( VULKAN_HPP_STATIC_ASSERT )
71 #  define VULKAN_HPP_STATIC_ASSERT static_assert
72 #endif
73 
74 #if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL )
75 #  define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1
76 #endif
77 
78 #if !defined( __has_include )
79 #  define __has_include( x ) false
80 #endif
81 
82 #if ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR )
83 #  define VULKAN_HPP_HAS_SPACESHIP_OPERATOR
84 #endif
85 
86 #if ( 201803 <= __cpp_lib_span )
87 #  define VULKAN_HPP_SUPPORT_SPAN
88 #endif
89 
90 #if defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_STD_MODULE ) && defined( VULKAN_HPP_ENABLE_STD_MODULE )
91 #  define VULKAN_HPP_STD_MODULE std.compat
92 #endif
93 
94 #ifndef VK_USE_64_BIT_PTR_DEFINES
95 #  if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || defined( _M_X64 ) || defined( __ia64 ) || \
96     defined( _M_IA64 ) || defined( __aarch64__ ) || defined( __powerpc64__ ) || ( defined( __riscv ) && __riscv_xlen == 64 )
97 #    define VK_USE_64_BIT_PTR_DEFINES 1
98 #  else
99 #    define VK_USE_64_BIT_PTR_DEFINES 0
100 #  endif
101 #endif
102 
103 // 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default.
104 // To enable this feature on 32-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 1
105 // To disable this feature on 64-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 0
106 #if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
107 #  if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )
108 #    define VULKAN_HPP_TYPESAFE_CONVERSION 1
109 #  endif
110 #endif
111 
112 #if defined( __GNUC__ )
113 #  define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
114 #endif
115 
116 #if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS )
117 #  if defined( __clang__ )
118 #    if __has_feature( cxx_unrestricted_unions )
119 #      define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
120 #    endif
121 #  elif defined( __GNUC__ )
122 #    if 40600 <= GCC_VERSION
123 #      define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
124 #    endif
125 #  elif defined( _MSC_VER )
126 #    if 1900 <= _MSC_VER
127 #      define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
128 #    endif
129 #  endif
130 #endif
131 
132 #if !defined( VULKAN_HPP_INLINE )
133 #  if defined( __clang__ )
134 #    if __has_attribute( always_inline )
135 #      define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
136 #    else
137 #      define VULKAN_HPP_INLINE inline
138 #    endif
139 #  elif defined( __GNUC__ )
140 #    define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
141 #  elif defined( _MSC_VER )
142 #    define VULKAN_HPP_INLINE inline
143 #  else
144 #    define VULKAN_HPP_INLINE inline
145 #  endif
146 #endif
147 
148 #if ( VULKAN_HPP_TYPESAFE_CONVERSION == 1 )
149 #  define VULKAN_HPP_TYPESAFE_EXPLICIT
150 #else
151 #  define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
152 #endif
153 
154 #if defined( __cpp_constexpr )
155 #  define VULKAN_HPP_CONSTEXPR constexpr
156 #  if 201304 <= __cpp_constexpr
157 #    define VULKAN_HPP_CONSTEXPR_14 constexpr
158 #  else
159 #    define VULKAN_HPP_CONSTEXPR_14
160 #  endif
161 #  if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) )
162 #    define VULKAN_HPP_CONSTEXPR_20 constexpr
163 #  else
164 #    define VULKAN_HPP_CONSTEXPR_20
165 #  endif
166 #  define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr
167 #else
168 #  define VULKAN_HPP_CONSTEXPR
169 #  define VULKAN_HPP_CONSTEXPR_14
170 #  define VULKAN_HPP_CONST_OR_CONSTEXPR const
171 #endif
172 
173 #if !defined( VULKAN_HPP_CONSTEXPR_INLINE )
174 #  if 201606L <= __cpp_inline_variables
175 #    define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline
176 #  else
177 #    define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR
178 #  endif
179 #endif
180 
181 #if !defined( VULKAN_HPP_NOEXCEPT )
182 #  if defined( _MSC_VER ) && ( _MSC_VER <= 1800 )
183 #    define VULKAN_HPP_NOEXCEPT
184 #  else
185 #    define VULKAN_HPP_NOEXCEPT     noexcept
186 #    define VULKAN_HPP_HAS_NOEXCEPT 1
187 #    if defined( VULKAN_HPP_NO_EXCEPTIONS )
188 #      define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept
189 #    else
190 #      define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS
191 #    endif
192 #  endif
193 #endif
194 
195 #if 14 <= VULKAN_HPP_CPP_VERSION
196 #  define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]]
197 #else
198 #  define VULKAN_HPP_DEPRECATED( msg )
199 #endif
200 
201 #if 17 <= VULKAN_HPP_CPP_VERSION
202 #  define VULKAN_HPP_DEPRECATED_17( msg ) [[deprecated( msg )]]
203 #else
204 #  define VULKAN_HPP_DEPRECATED_17( msg )
205 #endif
206 
207 #if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS )
208 #  define VULKAN_HPP_NODISCARD [[nodiscard]]
209 #  if defined( VULKAN_HPP_NO_EXCEPTIONS )
210 #    define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]]
211 #  else
212 #    define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
213 #  endif
214 #else
215 #  define VULKAN_HPP_NODISCARD
216 #  define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
217 #endif
218 
219 #if !defined( VULKAN_HPP_NAMESPACE )
220 #  define VULKAN_HPP_NAMESPACE vk
221 #endif
222 
223 #define VULKAN_HPP_STRINGIFY2( text ) #text
224 #define VULKAN_HPP_STRINGIFY( text )  VULKAN_HPP_STRINGIFY2( text )
225 #define VULKAN_HPP_NAMESPACE_STRING   VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE )
226 
227 #if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC )
228 #  if defined( VK_NO_PROTOTYPES )
229 #    define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
230 #  else
231 #    define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0
232 #  endif
233 #endif
234 
235 #if !defined( VULKAN_HPP_STORAGE_API )
236 #  if defined( VULKAN_HPP_STORAGE_SHARED )
237 #    if defined( _MSC_VER )
238 #      if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
239 #        define VULKAN_HPP_STORAGE_API __declspec( dllexport )
240 #      else
241 #        define VULKAN_HPP_STORAGE_API __declspec( dllimport )
242 #      endif
243 #    elif defined( __clang__ ) || defined( __GNUC__ )
244 #      if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
245 #        define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) )
246 #      else
247 #        define VULKAN_HPP_STORAGE_API
248 #      endif
249 #    else
250 #      define VULKAN_HPP_STORAGE_API
251 #      pragma warning Unknown import / export semantics
252 #    endif
253 #  else
254 #    define VULKAN_HPP_STORAGE_API
255 #  endif
256 #endif
257 
258 namespace VULKAN_HPP_NAMESPACE
259 {
260   class DispatchLoaderDynamic;
261 }  // namespace VULKAN_HPP_NAMESPACE
262 
263 #if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
264 #  if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
265 #    define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic
266 #    define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE                                             \
267       namespace VULKAN_HPP_NAMESPACE                                                                       \
268       {                                                                                                    \
269         VULKAN_HPP_STORAGE_API ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
270       }
271 
272 namespace VULKAN_HPP_NAMESPACE
273 {
274   extern VULKAN_HPP_STORAGE_API VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic;
275 }  // namespace VULKAN_HPP_NAMESPACE
276 #  else
277 #    define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic()
278 #    define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
279 #  endif
280 #endif
281 
282 #if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
283 #  if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
284 #    define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic
285 #  else
286 #    define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic
287 #  endif
288 #endif
289 
290 #if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER )
291 #  define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT
292 #  define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT
293 #  define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT
294 #else
295 #  define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT         = {}
296 #  define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr
297 #  define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT       = VULKAN_HPP_DEFAULT_DISPATCHER
298 #endif
299 
300 #if !defined( VULKAN_HPP_EXPECTED ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_expected )
301 #  if !( defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE ) )
302 #    include <expected>
303 #  endif
304 #  define VULKAN_HPP_EXPECTED   std::expected
305 #  define VULKAN_HPP_UNEXPECTED std::unexpected
306 #endif
307 
308 #if !defined( VULKAN_HPP_RAII_NAMESPACE )
309 #  define VULKAN_HPP_RAII_NAMESPACE raii
310 #endif
311 
312 #if defined( VULKAN_HPP_NO_EXCEPTIONS ) && defined( VULKAN_HPP_EXPECTED )
313 #  define VULKAN_HPP_RAII_NO_EXCEPTIONS
314 #  define VULKAN_HPP_RAII_CREATE_NOEXCEPT noexcept
315 #else
316 #  define VULKAN_HPP_RAII_CREATE_NOEXCEPT
317 #endif
318 
319 #endif