--- emacs-30.2/nt/inc/ms-w32.h.orig	2025-01-04 12:05:30.000000000 +0100
+++ emacs-30.2/nt/inc/ms-w32.h	2025-12-10 10:31:12.089835100 +0100
@@ -328,8 +328,8 @@
 #endif
 #define isatty    _isatty
 #define _longjmp  longjmp
-/* MinGW64 defines lseek to invoke lseek64.  */
-#ifndef lseek
+/* MinGW64 declares lseek to invoke lseek64.  */
+#ifdef _MSC_VER
 #define lseek     _lseek
 #endif
 #define popen     _popen
