Am 14. November 2024 um 05:18 schrieb "Bruno Haible":
> And with this additional patch, ftello() works on large files on mingw.
> 
> 
&gt; 2024-11-14  Bruno Haible  <br...@clisp.org>
&gt; 
&gt;    ftello: Fix override on mingw.
&gt;    Reported by Markus Mützel <markus.muet...@gmx.de> in
&gt;    <https: lists.gnu.org="" archive="" html="" bug-gnulib="" 2024-11="" 
msg00108.html="">.
&gt;    * lib/ftello.c: Test whether module 'largefile' is in use, not
&gt;    whether it had to override 'off_t'.
&gt; 
&gt; diff --git a/lib/ftello.c b/lib/ftello.c
&gt; index 88247bca8e..37fe93a34e 100644
&gt; --- a/lib/ftello.c
&gt; +++ b/lib/ftello.c
&gt; @@ -34,7 +34,7 @@ ftello (FILE *fp)
&gt;  # undef ftell
&gt;  # define ftello ftell
&gt;  #endif
&gt; -#if _GL_WINDOWS_64_BIT_OFF_T
&gt; +#if (defined _WIN32 &amp;&amp; !defined __CYGWIN__) &amp;&amp; 
_FILE_OFFSET_BITS == 64
&gt;  # undef ftello
&gt;  # if HAVE__FTELLI64 /* msvc, mingw64 */
&gt;  #  define ftello _ftelli64
&gt; 


Thank you very much for the patch series.

With the same reasoning as for ftello.c, should this also be changed in 
fseeko.c?

diff --git a/lib/fseeko.c b/lib/fseeko.c
index 2c3b053a3b..9d003208ba 100644
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -31,7 +31,10 @@ fseeko (FILE *fp, off_t offset, int whence)
 # undef fseek
 # define fseeko fseek
 #endif
-#if _GL_WINDOWS_64_BIT_OFF_T
+#if (defined _WIN32 &amp;&amp; !defined __CYGWIN__) \
+    /* We need to test _FILE_OFFSET_BITS for mingw-w64 */   \
+    /* and _GL_WINDOWS_64_BIT_OFF_T for MSVC.  */           \
+    &amp;&amp; (_FILE_OFFSET_BITS == 64 || _GL_WINDOWS_64_BIT_OFF_T)
 # undef fseeko
 # if HAVE__FSEEKI64 &amp;&amp; HAVE_DECL__FSEEKI64 /* msvc, mingw since 
msvcrt8.0, mingw64 */
 #  define fseeko _fseeki64
</https:></markus.muet...@gmx.de></br...@clisp.org>

Reply via email to