aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/file.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-06-25 00:42:27 +0300
committerMartin Storsjö <martin@martin.st>2012-06-29 15:53:41 +0300
commit3b1ab197be185b61247ef2472f15eeac3e765252 (patch)
tree532e09dfabfb9d9510d2d01b3fab2ede77b4a42a /libavformat/file.c
parentf985113075b0c571b1b1b166fe28f87f0f291be5 (diff)
downloadffmpeg-3b1ab197be185b61247ef2472f15eeac3e765252.tar.gz
file: Only include unistd.h if it exists
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. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/file.c')
-rw-r--r--libavformat/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/file.c b/libavformat/file.c
index cca9ec1a06..0e3577d070 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"