diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 4720f453798b90d76fd391d9079ea3fdceb76645..21af0d69c4377502e829b6fa680b663f3564535d 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -3055,7 +3055,7 @@ namespace
 		_fseeki64(file, 0, SEEK_END);
 		length_type length = _ftelli64(file);
 		_fseeki64(file, 0, SEEK_SET);
-	#elif defined(__MINGW32__) && !defined(__NO_MINGW_LFS)
+	#elif defined(__MINGW32__) && !defined(__NO_MINGW_LFS) && !defined(__STRICT_ANSI__)
 		// there are 64-bit versions of fseek/ftell, let's use them
 		typedef off64_t length_type;