From: Ronald S. Bultje Date: Sun, 24 Jun 2012 21:42:27 +0000 (+0300) Subject: file: Only include unistd.h if it exists X-Git-Tag: android-x86-4.4-r1~8529^2~1534 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3b1ab197be185b61247ef2472f15eeac3e765252;p=android-x86%2Fexternal-ffmpeg.git 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ö --- diff --git a/configure b/configure index 3619eff52e..1290369f15 100755 --- a/configure +++ b/configure @@ -1093,6 +1093,7 @@ HAVE_LIST=" ibm_asm inet_aton inline_asm + io_h isatty isinf isnan @@ -2879,6 +2880,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 cca9ec1a06..0e3577d070 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -22,10 +22,12 @@ #include "libavutil/avstring.h" #include "avformat.h" #include -#if HAVE_SETMODE +#if HAVE_IO_H #include #endif +#if HAVE_UNISTD_H #include +#endif #include #include #include "os_support.h"