Commit 24a0d3bc6d16e1041d92f82dec5387a24a859420

Sam Lantinga 2017-08-27T22:27:45

Don't define Vulkan types if vulkan.h has already been included

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/include/SDL_vulkan.h b/include/SDL_vulkan.h
index f7b5191..d56c3d8 100644
--- a/include/SDL_vulkan.h
+++ b/include/SDL_vulkan.h
@@ -37,6 +37,7 @@ extern "C" {
 #endif
 
 /* Avoid including vulkan.h */
+#ifndef VULKAN_H_
 #define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
 
 #if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
@@ -48,6 +49,8 @@ extern "C" {
 VK_DEFINE_HANDLE(VkInstance)
 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
 
+#endif /* !VULKAN_H_ */
+
 typedef VkInstance SDL_vulkanInstance;
 typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */