From 149ecffd6f4296fa21955c835f7be45525033bf2 Mon Sep 17 00:00:00 2001
From: dv-senna <[EMAIL REDACTED]>
Date: Tue, 29 Oct 2024 18:30:10 +0100
Subject: [PATCH] SDL_vulkan.h: undefine VK_DEFINE_HANDLER and
VK_DEFINE_NON_DISPATCHABLE_HANDLE
Allows including vulkan.hpp in user code in C++ before SDL_vulkan.h w/o errors.
Fixes: https://github.com/libsdl-org/SDL/issues/11328 .
---
include/SDL3/SDL_vulkan.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h
index ef3303e7b6071..1ce0e34c65bdc 100644
--- a/include/SDL3/SDL_vulkan.h
+++ b/include/SDL3/SDL_vulkan.h
@@ -69,6 +69,10 @@ VK_DEFINE_HANDLE(VkPhysicalDevice)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
struct VkAllocationCallbacks;
+/* 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 */
/**