Debian Codegraph @

subprojects/Vulkan-Headers-1.4.346/include/vulkan/vulkan_hpp_macros.hpp

raw symbols SCIP
1 // Copyright 2015-2026 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 #define VULKAN_HPP_STRINGIFY2( text ) #text
39 #define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text )
40 #define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE )
41
42 #if defined( __clang__ ) || defined( __GNUC__ ) || defined( __GNUG__ )
43 # define VULKAN_HPP_COMPILE_WARNING( text ) _Pragma( VULKAN_HPP_STRINGIFY( GCC warning text ) )
44 #elif defined( _MSC_VER )
45 # define VULKAN_HPP_COMPILE_WARNING( text ) _Pragma( VULKAN_HPP_STRINGIFY( message( __FILE__ "(" VULKAN_HPP_STRINGIFY( __LINE__ ) "): warning: " text ) ) )
46 #else
47 # define VULKAN_HPP_COMPILE_WARNING( text )
48 #endif
49
50 #if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
51 # if !defined( VULKAN_HPP_NO_SMART_HANDLE )
52 # define VULKAN_HPP_NO_SMART_HANDLE
53 # endif
54 #endif
55
56 #if defined( VULKAN_HPP_NO_CONSTRUCTORS )
57 # if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS )
58 # define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS
59 # endif
60 # if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS )
61 # define VULKAN_HPP_NO_UNION_CONSTRUCTORS
62 # endif
63 #endif
64
65 #if defined( VULKAN_HPP_NO_SETTERS )
66 # if !defined( VULKAN_HPP_NO_STRUCT_SETTERS )
67 # define VULKAN_HPP_NO_STRUCT_SETTERS
68 # endif
69 # if !defined( VULKAN_HPP_NO_UNION_SETTERS )
70 # define VULKAN_HPP_NO_UNION_SETTERS
71 # endif
72 #endif
73
74 #if !defined( VULKAN_HPP_ASSERT )
75 # define VULKAN_HPP_ASSERT assert
76 #endif
77
78 #if !defined( VULKAN_HPP_ASSERT_ON_RESULT )
79 # define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT
80 #endif
81
82 #if !defined( VULKAN_HPP_STATIC_ASSERT )
83 # define VULKAN_HPP_STATIC_ASSERT static_assert
84 #endif
85
86 #if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL )
87 # define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1
88 #endif
89
90 #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
91 # if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) && !defined( VULKAN_HPP_CXX_MODULE )
92 # include <dlfcn.h>
93 # elif defined( _WIN32 ) && !defined( VULKAN_HPP_NO_WIN32_PROTOTYPES )
94 using HINSTANCE = struct HINSTANCE__ *;
95 # if defined( _WIN64 )
96 # include <cstdint>
97 using FARPROC = int64_t( __stdcall * )();
98 # else
99 using FARPROC = int( __stdcall * )();
100 # endif
101 extern "C" __declspec( dllimport ) HINSTANCE __stdcall LoadLibraryA( char const * lpLibFileName );
102 extern "C" __declspec( dllimport ) int __stdcall FreeLibrary( HINSTANCE hLibModule );
103 extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE hModule, char const * lpProcName );
104 # endif
105 #endif
106
107 #if !defined( __has_include )
108 # define __has_include( x ) false
109 #endif
110
111 #if defined( __cpp_lib_three_way_comparison ) && ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR )
112 # define VULKAN_HPP_HAS_SPACESHIP_OPERATOR
113 #endif
114
115 #if defined( __cpp_lib_span ) && ( 201803 <= __cpp_lib_span )
116 # define VULKAN_HPP_SUPPORT_SPAN
117 #endif
118
119 #if defined( VULKAN_HPP_CXX_MODULE )
120 # define VULKAN_HPP_EXPORT export
121 #else
122 # define VULKAN_HPP_EXPORT
123 #endif
124
125 #if defined( VULKAN_HPP_CXX_MODULE ) && !( defined( __cpp_modules ) && defined( __cpp_lib_modules ) )
126 VULKAN_HPP_COMPILE_WARNING( "This is a non-conforming implementation of C++ named modules and the standard library module." )
127 #endif
128
129 #ifndef VK_USE_64_BIT_PTR_DEFINES
130 # if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || defined( _M_X64 ) || defined( __ia64 ) || \
131 defined( _M_IA64 ) || defined( __aarch64__ ) || defined( __powerpc64__ ) || ( defined( __riscv ) && __riscv_xlen == 64 )
132 # define VK_USE_64_BIT_PTR_DEFINES 1
133 # else
134 # define VK_USE_64_BIT_PTR_DEFINES 0
135 # endif
136 #endif
137
138 // 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default.
139 // To enable this feature on 32-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 1
140 // To disable this feature on 64-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 0
141 #if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
142 # if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )
143 # define VULKAN_HPP_TYPESAFE_CONVERSION 1
144 # endif
145 #endif
146
147 #if defined( __GNUC__ )
148 # define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
149 #endif
150
151 #if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS )
152 # if defined( __clang__ )
153 # if __has_feature( cxx_unrestricted_unions )
154 # define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
155 # endif
156 # elif defined( __GNUC__ )
157 # if 40600 <= GCC_VERSION
158 # define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
159 # endif
160 # elif defined( _MSC_VER )
161 # if 1900 <= _MSC_VER
162 # define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
163 # endif
164 # endif
165 #endif
166
167 #if !defined( VULKAN_HPP_INLINE )
168 # if defined( __clang__ )
169 # if __has_attribute( always_inline )
170 # define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
171 # else
172 # define VULKAN_HPP_INLINE inline
173 # endif
174 # elif defined( __GNUC__ )
175 # define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
176 # elif defined( _MSC_VER )
177 # define VULKAN_HPP_INLINE inline
178 # else
179 # define VULKAN_HPP_INLINE inline
180 # endif
181 #endif
182
183 #if ( VULKAN_HPP_TYPESAFE_CONVERSION == 1 )
184 # define VULKAN_HPP_TYPESAFE_EXPLICIT
185 #else
186 # define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
187 #endif
188
189 #if defined( __cpp_constexpr )
190 # define VULKAN_HPP_CONSTEXPR constexpr
191 # if 201304 <= __cpp_constexpr
192 # define VULKAN_HPP_CONSTEXPR_14 constexpr
193 # else
194 # define VULKAN_HPP_CONSTEXPR_14
195 # endif
196 # if 201603 <= __cpp_constexpr
197 # define VULKAN_HPP_CONSTEXPR_17 constexpr
198 # else
199 # define VULKAN_HPP_CONSTEXPR_17
200 # endif
201 # if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) )
202 # define VULKAN_HPP_CONSTEXPR_20 constexpr
203 # else
204 # define VULKAN_HPP_CONSTEXPR_20
205 # endif
206 # define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr
207 #else
208 # define VULKAN_HPP_CONSTEXPR
209 # define VULKAN_HPP_CONSTEXPR_14
210 # define VULKAN_HPP_CONST_OR_CONSTEXPR const
211 #endif
212
213 #if !defined( VULKAN_HPP_CONSTEXPR_INLINE )
214 # if 201606L <= __cpp_inline_variables
215 # define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline
216 # else
217 # define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR
218 # endif
219 #endif
220
221 #if !defined( VULKAN_HPP_NOEXCEPT )
222 # if defined( _MSC_VER ) && ( _MSC_VER <= 1800 )
223 # define VULKAN_HPP_NOEXCEPT
224 # else
225 # define VULKAN_HPP_NOEXCEPT noexcept
226 # define VULKAN_HPP_HAS_NOEXCEPT 1
227 # if defined( VULKAN_HPP_NO_EXCEPTIONS )
228 # define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept
229 # else
230 # define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS
231 # endif
232 # endif
233 #endif
234
235 #if 14 <= VULKAN_HPP_CPP_VERSION
236 # define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]]
237 #else
238 # define VULKAN_HPP_DEPRECATED( msg )
239 #endif
240
241 #if 17 <= VULKAN_HPP_CPP_VERSION
242 # define VULKAN_HPP_DEPRECATED_17( msg ) [[deprecated( msg )]]
243 #else
244 # define VULKAN_HPP_DEPRECATED_17( msg )
245 #endif
246
247 #if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS )
248 # define VULKAN_HPP_NODISCARD [[nodiscard]]
249 # if defined( VULKAN_HPP_NO_EXCEPTIONS )
250 # define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]]
251 # else
252 # define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
253 # endif
254 #else
255 # define VULKAN_HPP_NODISCARD
256 # define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
257 #endif
258
259 #if 17 <= VULKAN_HPP_CPP_VERSION
260 # define VULKAN_HPP_MAYBE_UNUSED [[maybe_unused]]
261 # define VULKAN_HPP_UNUSED( var )
262 #else
263 # define VULKAN_HPP_MAYBE_UNUSED
264 # define VULKAN_HPP_UNUSED( var ) ( (void)( var ) )
265 #endif
266
267 #if !defined( VULKAN_HPP_NAMESPACE )
268 # define VULKAN_HPP_NAMESPACE vk
269 #endif
270
271 #if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC )
272 # if defined( VK_NO_PROTOTYPES )
273 # define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
274 # else
275 # define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0
276 # endif
277 #endif
278
279 #if !defined( VULKAN_HPP_STORAGE_API )
280 # if defined( VULKAN_HPP_STORAGE_SHARED )
281 # if defined( _MSC_VER )
282 # if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
283 # define VULKAN_HPP_STORAGE_API __declspec( dllexport )
284 # else
285 # define VULKAN_HPP_STORAGE_API __declspec( dllimport )
286 # endif
287 # elif defined( __clang__ ) || defined( __GNUC__ )
288 # if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
289 # define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) )
290 # else
291 # define VULKAN_HPP_STORAGE_API
292 # endif
293 # else
294 # define VULKAN_HPP_STORAGE_API
295 # pragma warning Unknown import / export semantics
296 # endif
297 # else
298 # define VULKAN_HPP_STORAGE_API
299 # endif
300 #endif
301
302 #if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC_TYPE )
303 # define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC_TYPE VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
304 #endif
305 #if !defined( VULKAN_HPP_DISPATCH_LOADER_STATIC_TYPE )
306 # define VULKAN_HPP_DISPATCH_LOADER_STATIC_TYPE VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
307 #endif
308
309 #if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
310 # if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
311 # define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC_TYPE
312 # else
313 # define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE VULKAN_HPP_DISPATCH_LOADER_STATIC_TYPE
314 # endif
315 #endif
316
317 #if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
318 # if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
319 # define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
320 # define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
321 namespace VULKAN_HPP_NAMESPACE \
322 { \
323 namespace detail \
324 { \
325 VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
326 } \
327 }
328 # else
329 # define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
330 # define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
331 # endif
332 #else
333 # define VULKAN_HPP_DEFAULT_DISPATCHER_HANDLED
334 #endif
335
336 #if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER )
337 # define VULKAN_HPP_DEFAULT_ASSIGNMENT( assignment )
338 #else
339 # define VULKAN_HPP_DEFAULT_ASSIGNMENT( assignment ) = assignment
340 #endif
341 #define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT VULKAN_HPP_DEFAULT_ASSIGNMENT( VULKAN_HPP_DEFAULT_DISPATCHER )
342
343 #if !defined( VULKAN_HPP_EXPECTED ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_expected ) && defined( VULKAN_HPP_USE_STD_EXPECTED )
344 # if !( defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE ) )
345 # include <expected>
346 # endif
347 # define VULKAN_HPP_EXPECTED std::expected
348 # define VULKAN_HPP_UNEXPECTED std::unexpected
349 #endif
350
351 #if !defined( VULKAN_HPP_RAII_NAMESPACE )
352 # define VULKAN_HPP_RAII_NAMESPACE raii
353 # define VULKAN_HPP_RAII_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE )
354 #endif
355
356 #endif