From: Bruno Haible Date: Thu, 14 Nov 2024 04:18:00 +0000 (+0100) Subject: ftello: Fix override on mingw. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=58153aa2eb2649763c126a035568cb6e1c1e6f2e;p=gnulib.git ftello: Fix override on mingw. Reported by Markus Mützel in . * lib/ftello.c: Test whether module 'largefile' is in use, not only whether it had to override 'off_t'. --- diff --git a/ChangeLog b/ChangeLog index ddfdff3dd3..3bff4b6c4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-11-14 Bruno Haible + + ftello: Fix override on mingw. + Reported by Markus Mützel in + . + * lib/ftello.c: Test whether module 'largefile' is in use, not only + whether it had to override 'off_t'. + 2024-11-14 Bruno Haible fseeko: Fix potentially wrong override. diff --git a/lib/ftello.c b/lib/ftello.c index 64119aabf1..ab5650a5fd 100644 --- a/lib/ftello.c +++ b/lib/ftello.c @@ -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