From: "Ronald S. Bultje" <[email protected]>

It is included for the open/read/write/close functions. On
MSVC, where this header does not exist, the same functions
are provided by io.h, which is already included.

On windows, these functions are provided by io.h. Make sure
io.h is included if it exists, regardless of the setmode
function.
---
 configure          |    2 ++
 libavformat/file.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index b47a22f..d3795e4 100755
--- a/configure
+++ b/configure
@@ -1093,6 +1093,7 @@ HAVE_LIST="
     ibm_asm
     inet_aton
     inline_asm
+    io_h
     isatty
     jack_port_get_latency_range
     ldbrx
@@ -2871,6 +2872,7 @@ check_func_headers windows.h VirtualAlloc
 check_header dlfcn.h
 check_header dxva.h
 check_header dxva2api.h
+check_header io.h
 check_header malloc.h
 check_header poll.h
 check_header sys/mman.h
diff --git a/libavformat/file.c b/libavformat/file.c
index cca9ec1..0e3577d 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -22,10 +22,12 @@
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include <fcntl.h>
-#if HAVE_SETMODE
+#if HAVE_IO_H
 #include <io.h>
 #endif
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <sys/stat.h>
 #include <stdlib.h>
 #include "os_support.h"
-- 
1.7.9.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to