diff mbox series

[FFmpeg-devel] hwcontext_vulkan: guard unistd.h include

Message ID 20230922164921.100331-2-ben@bcheng.me
State Accepted
Commit 185871fdd39762295973c1f3db1459e04121317c
Headers show
Series [FFmpeg-devel] hwcontext_vulkan: guard unistd.h include | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Benjamin Cheng Sept. 22, 2023, 4:49 p.m. UTC
win32 typically doesn't have unistd.h, so always including it will break
MSVC builds. The usage of those POSIX functions are already guarded by
_WIN32, so use that to guard unistd.h include as well.
---
 libavutil/hwcontext_vulkan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index c676f4fc57..6c573abb8b 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -27,10 +27,10 @@ 
 #include "compat/w32dlfcn.h"
 #else
 #include <dlfcn.h>
+#include <unistd.h>
 #endif
 
 #include "thread.h"
-#include <unistd.h>
 
 #include "config.h"
 #include "pixdesc.h"