Skip to content

Commit

Permalink
SDL_vulkan.h: undefine VK_DEFINE_HANDLER and VK_DEFINE_NON_DISPATCHAB…
Browse files Browse the repository at this point in the history
…LE_HANDLE

Allows including vulkan.hpp in user code in C++ before SDL_vulkan.h w/o errors.
Fixes:  #11328 .

(cherry picked from commit 149ecff)
  • Loading branch information
Dv-Senna authored and sezero committed Oct 29, 2024
1 parent 5b0e838 commit 478dff3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/SDL_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ extern "C" {
VK_DEFINE_HANDLE(VkInstance)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)

/* Make sure to undef to avoid issues in case of later vulkan include */
#undef VK_DEFINE_HANDLE
#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE

#endif /* !NO_SDL_VULKAN_TYPEDEFS */

typedef VkInstance SDL_vulkanInstance;
Expand Down

0 comments on commit 478dff3

Please sign in to comment.