avutil: Include io.h with a separate condition from windows console functions
authorMartin Storsjö <martin@martin.st>
Fri, 30 Nov 2012 14:56:54 +0000 (16:56 +0200)
committerMartin Storsjö <martin@martin.st>
Fri, 30 Nov 2012 14:56:54 +0000 (16:56 +0200)
Not all versions of windows have the console color functions,
while io.h might be needed for isatty (which can be found in
unistd.h or io.h).

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

index d2cf88fd4b6a00e3e336c34da6fa96a74c046331..d335944330865fb83fa99186a0ec1ade3c108507 100644 (file)
@@ -29,6 +29,9 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
 #include <stdlib.h>
 #include "avstring.h"
 #include "avutil.h"
@@ -40,7 +43,6 @@ static int flags;
 
 #if defined(_WIN32) && !defined(__MINGW32CE__)
 #include <windows.h>
-#include <io.h>
 static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
 static int16_t background, attr_orig;
 static HANDLE con;