diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index 8a757d71a3e61d1b12a2fd97e9e4cc1aefd1a03e..f751d41c93fafd613d9b3755e8fc7411fe14d216 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -39,7 +39,7 @@
 #  define stat _stati64
 #  undef fstat
 #  define fstat(f,s) _fstati64((f), (s))
-#endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */
+#endif /* defined(_WIN32) && !defined(__MINGW32CE__) */
 
 #ifdef _WIN32
 #if HAVE_DIRECT_H