avutil: Include io.h with a separate condition from MapViewOfFile
authorMartin Storsjö <martin@martin.st>
Thu, 29 Nov 2012 15:02:42 +0000 (17:02 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 29 Nov 2012 16:19:57 +0000 (18:19 +0200)
The existence of MapViewOfFile isn't linked to the existence of
io.h.

Not all versions of windows have MapViewOfFile (in particular,
Windows Phone 8 and the "metro" windows 8 API subset don't),
while they still have io.h (and need it for open/read/close).

Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil/file.c

index 41bd0dd..ce02487 100644 (file)
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
 #if HAVE_MMAP
 #include <sys/mman.h>
 #elif HAVE_MAPVIEWOFFILE
-#include <io.h>
 #include <windows.h>
 #endif