[FFmpeg-cvslog] hwcontext_vulkan: fix CreateSemaphore conflict with synchapi.h

Lynne git at videolan.org
Fri Nov 12 15:51:29 EET 2021


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Fri Nov 12 14:36:20 2021 +0100| [296cb99d46b5f72d393ec06bef2753098d19fad2] | committer: Lynne

hwcontext_vulkan: fix CreateSemaphore conflict with synchapi.h

Include windows.h to fix it. Normally, it'd be better to include it in
vulkan_functions.h, but I'm reasonably confident nothing else that uses
the Vulkan code will need to include Windows functions and not windows.h.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=296cb99d46b5f72d393ec06bef2753098d19fad2
---

 libavutil/hwcontext_vulkan.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 6e746d4aa4..3c86e2d683 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -19,6 +19,13 @@
 #define VK_NO_PROTOTYPES
 #define VK_ENABLE_BETA_EXTENSIONS
 
+#ifdef _WIN32
+#include <windows.h> /* Included to prevent conflicts with CreateSemaphore */
+#include "compat/w32dlfcn.h"
+#else
+#include <dlfcn.h>
+#endif
+
 #include <unistd.h>
 
 #include "config.h"
@@ -32,12 +39,6 @@
 
 #include "vulkan_loader.h"
 
-#ifdef _WIN32
-#include "compat/w32dlfcn.h"
-#else
-#include <dlfcn.h>
-#endif
-
 #if CONFIG_LIBDRM
 #include <xf86drm.h>
 #include <drm_fourcc.h>



More information about the ffmpeg-cvslog mailing list