Added VULKAN_HPP_NO_WIN32_PROTOTYPES preprocessor condition (#1756)

* Added VULKAN_HPP_NO_WIN32_PROTOTYPES preprocessor condition which disables dynamic loader type declaration for win32

* Added VULKAN_HPP_NO_WIN32_PROTOTYPES README.md section
This commit is contained in:
Nikolai Siukosev 2024-01-09 12:13:37 +04:00 committed by GitHub
parent e84352916a
commit 180ef2f598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -925,6 +925,11 @@ By defining ```VULKAN_HPP_NO_SMART_HANDLE``` before including vulkan.hpp, the he
With C++20, the so-called spaceship-operator ```<=>``` is introduced. If that operator is supported, all the structs and classes in vulkan.hpp use the default implementation of it. As currently some implementations of this operator are very slow, and others seem to be incomplete, by defining ```VULKAN_HPP_NO_SPACESHIP_OPERATOR``` before including vulkan.hpp you can remove that operator from those structs and classes. With C++20, the so-called spaceship-operator ```<=>``` is introduced. If that operator is supported, all the structs and classes in vulkan.hpp use the default implementation of it. As currently some implementations of this operator are very slow, and others seem to be incomplete, by defining ```VULKAN_HPP_NO_SPACESHIP_OPERATOR``` before including vulkan.hpp you can remove that operator from those structs and classes.
#### VULKAN_HPP_NO_WIN32_PROTOTYPES
By default, if ```VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL``` is enabled on Win32, ```vulkan.hpp``` declares ```HINSTANCE```, ```LoadLibraryA```, and other required symbols. It could cause conflicts with the ```Windows.h``` alternatives, such as ```WindowsHModular```.
With this define, you can disable these declarations, but you will have to declare them before the ```vulkan.hpp``` is included.
#### VULKAN_HPP_RAII_NO_EXCEPTIONS #### VULKAN_HPP_RAII_NO_EXCEPTIONS
If both, VULKAN_HPP_NO_EXCEPTIONS and VULKAN_HPP_EXPECTED are defined, the vk::raii-classes don't throw exceptions. That is, the actual constructors are not available, but the creation-functions must be used. For more details have a look at the vk_raii_ProgrammingGuide.md. If both, VULKAN_HPP_NO_EXCEPTIONS and VULKAN_HPP_EXPECTED are defined, the vk::raii-classes don't throw exceptions. That is, the actual constructors are not available, but the creation-functions must be used. For more details have a look at the vk_raii_ProgrammingGuide.md.

View File

@ -25,7 +25,7 @@
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) # if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )
# include <dlfcn.h> # include <dlfcn.h>
# elif defined( _WIN32 ) # elif defined( _WIN32 ) && !defined( VULKAN_HPP_NO_WIN32_PROTOTYPES )
typedef struct HINSTANCE__ * HINSTANCE; typedef struct HINSTANCE__ * HINSTANCE;
# if defined( _WIN64 ) # if defined( _WIN64 )
typedef int64_t( __stdcall * FARPROC )(); typedef int64_t( __stdcall * FARPROC )();