[FFmpeg-cvslog] os_support: Include all the necessary headers for the win32 open function

Ronald S. Bultje git at videolan.org
Sat Jun 30 22:47:41 CEST 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sun Jun 24 21:29:14 2012 +0300| [5aff37d28d6a140f70f6cae996e6f55b21b1106d] | committer: Martin Storsjö

os_support: Include all the necessary headers for the win32 open function

io.h is required for open and _wopen, and fcntl.h is required for
the O_CREAT flag. On mingw, fcntl.h is included by os_support.h (and
the mingw fcntl.h includes io.h), but include it explicitly here
since this implementation requires it.

Also move the #undef open up. open must not be defined to ff_win32_open
while including the headers that declare the open function. On mingw,
this happened in os_support.h before open was redirected.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/os_support.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 0cbaf45..8054ba6 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -28,9 +28,11 @@
 #include "os_support.h"
 
 #if defined(_WIN32) && !defined(__MINGW32CE__)
+#undef open
+#include <fcntl.h>
+#include <io.h>
 #include <windows.h>
 
-#undef open
 int ff_win32_open(const char *filename_utf8, int oflag, int pmode)
 {
     int fd;



More information about the ffmpeg-cvslog mailing list