Module: Mesa
Branch: master
Commit: 664a80387966f56b5fa62b1ba8270148c9a8d06e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=664a80387966f56b5fa62b1ba8270148c9a8d06e

Author: Michel Zou <[email protected]>
Date:   Thu Feb 11 09:11:42 2021 +0100

vulkan: Fix windows api conflict

It must be undefined in the header too

Fixes: e487ae1b
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8975>

---

 src/vulkan/meson.build                   |  3 +++
 src/vulkan/util/vk_dispatch_table_gen.py | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/vulkan/meson.build b/src/vulkan/meson.build
index 22610a5493f..9558a957844 100644
--- a/src/vulkan/meson.build
+++ b/src/vulkan/meson.build
@@ -56,6 +56,9 @@ if with_xlib_lease
   vulkan_wsi_deps += [dep_xlib_xrandr]
   vulkan_wsi_list += ['xlib_xrandr']
 endif
+if with_platform_windows
+  vulkan_wsi_args += ['-DVK_USE_PLATFORM_WIN32_KHR']
+endif
 
 
 subdir('util')
diff --git a/src/vulkan/util/vk_dispatch_table_gen.py 
b/src/vulkan/util/vk_dispatch_table_gen.py
index 76bf2710ea8..b0bf160a5bc 100644
--- a/src/vulkan/util/vk_dispatch_table_gen.py
+++ b/src/vulkan/util/vk_dispatch_table_gen.py
@@ -52,6 +52,16 @@ TEMPLATE_H = Template(COPYRIGHT + """\
 
 #include "vk_extensions.h"
 
+/* Windows api conflict */
+#ifdef _WIN32
+#ifdef CreateSemaphore
+#undef CreateSemaphore
+#endif
+#ifdef CreateEvent
+#undef CreateEvent
+#endif
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -195,16 +205,6 @@ TEMPLATE_C = Template(COPYRIGHT + """\
 #include "util/macros.h"
 #include "string.h"
 
-/* Windows api conflict */
-#ifdef _WIN32
-#ifdef CreateSemaphore
-#undef CreateSemaphore
-#endif
-#ifdef CreateEvent
-#undef CreateEvent
-#endif
-#endif
-
 <%def name="load_dispatch_table(type, VkType, ProcAddr, entrypoints)">
 void
 vk_${type}_dispatch_table_load(struct vk_${type}_dispatch_table *table,

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to