summaryrefslogtreecommitdiff
path: root/libavformat/file.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-06-25 00:42:27 +0300
committerMichael Niedermayer <michaelni@gmx.at>2012-09-07 18:41:23 +0200
commitf3be3597079be7cd7adbb8392c32e408cadd3da2 (patch)
treebabf3ecce13546fb87b30c86467eaff3505b84d4 /libavformat/file.c
parenta4d71eb5c3a6265afee1c25fea549dd071c1f4a6 (diff)
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> Conflicts: configure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 c54ec2882f..4e8129e9ae 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"