]> Savannah Git Hosting - gnulib.git/commitdiff
ftello: Fix override on mingw.
authorBruno Haible <bruno@clisp.org>
Thu, 14 Nov 2024 04:18:00 +0000 (05:18 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 1 Dec 2024 06:57:17 +0000 (07:57 +0100)
Reported by Markus Mützel <markus.muetzel@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00108.html>.

* lib/ftello.c: Test whether module 'largefile' is in use, not only
whether it had to override 'off_t'.

ChangeLog
lib/ftello.c

index ddfdff3dd34e37f00d077f6dd6327405f4bc2025..3bff4b6c4baf6c0f38efbeec2073cdd852b30645 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-14  Bruno Haible  <bruno@clisp.org>
+
+       ftello: Fix override on mingw.
+       Reported by Markus Mützel <markus.muetzel@gmx.de> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00108.html>.
+       * lib/ftello.c: Test whether module 'largefile' is in use, not only
+       whether it had to override 'off_t'.
+
 2024-11-14  Bruno Haible  <bruno@clisp.org>
 
        fseeko: Fix potentially wrong override.
index 64119aabf1cc6d1a81c40f6afa898d14372ab995..ab5650a5fd51355ed03502baab86a7fa4022379a 100644 (file)
@@ -34,7 +34,10 @@ ftello (FILE *fp)
 # undef ftell
 # define ftello ftell
 #endif
-#if _GL_WINDOWS_64_BIT_OFF_T
+#if (defined _WIN32 && !defined __CYGWIN__) \
+    /* We need to test _FILE_OFFSET_BITS for mingw-w64 */   \
+    /* and _GL_WINDOWS_64_BIT_OFF_T for MSVC.  */           \
+    && (_FILE_OFFSET_BITS == 64 || _GL_WINDOWS_64_BIT_OFF_T)
 # undef ftello
 # if HAVE__FTELLI64 /* msvc, mingw64 */
 #  define ftello _ftelli64