diff --git a/lib/config-win32.h b/lib/config-win32.h
index a0c0bf5b20b03e5fd9f3124e84ab942386af2930..e43c88e34e039621941188bc4643f16e66e0a947 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -402,6 +402,10 @@
 #  endif
 #endif
 
+#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
+#  define USE_WIN32_LARGE_FILES
+#endif
+
 #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
 #  define USE_WIN32_SMALL_FILES
 #endif
diff --git a/src/config-win32.h b/src/config-win32.h
index 654d892d840c5a409e0fd98fa537deabc610efbf..cafc145769ea66328c5ffd0aa93f066b4db102ab 100644
--- a/src/config-win32.h
+++ b/src/config-win32.h
@@ -247,6 +247,10 @@
 #  endif
 #endif
 
+#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
+#  define USE_WIN32_LARGE_FILES
+#endif
+
 #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
 #  define USE_WIN32_SMALL_FILES
 #endif