diff --git a/libavutil/log.c b/libavutil/log.c
index e2773d433deb742c209cf1490d8492a490fb8488..9f1d59ab9c32a4a069d7aff744bf04fb1d6bfd55 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -39,6 +39,7 @@ 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;