Am 14. November 2024 um 15:31 schrieb "Bruno Haible" > > Markus Mützel wrote: > > If the unit test passes with it, it might be passing erroneously. > > No: Before making the fixes and adding the unit test, I verified that without > the fixes, the unit test failed. In other words, the unit test is able > to detect the bugs we are interested in. > > > > - Apparently the mingw fseeko already supports the 64-bit argument fine. > > > > > > "fseeko" has the following prototype in mingw-w64: > > https://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-crt/stdio/fseeko32.c > > int fseeko(FILE* stream, _off_t offset, int whence) > > > > The offset is of type "_off_t". That type is defined like this in mingw-w64: > > https://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-headers/crt/_mingw_off_t.h > > typedef long _off_t; > > > > "long" is a 32-bit integer on Windows. So, the "fseeko" function from mingw-w64 shouldn't work for large files. > > > > Does that make sense? > > No. You missed the facts that > - the Gnulib 'largefile' module defines _FILE_OFFSET_BITS to 64 on mingw, > - mingw-w64-headers/crt/stdio.h thus does a > #define fseeko fseeko64 > - fseeko64 is defined in mingw-w64-crt/stdio/fseeko64.c and takes a 64-bit > argument. >
Thank you for clarifying. That makes sense. Markus