diff --git a/libavutil/log.c b/libavutil/log.c
index e4a9fec552b3b44ceaddf4c0e73f7309580abed8..e2773d433deb742c209cf1490d8492a490fb8488 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -26,7 +26,7 @@
 
 #include "config.h"
 
-#if HAVE_ISATTY
+#if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <stdlib.h>