madler / zlib

A massively spiffy yet delicately unobtrusive compression library.
http://zlib.net/
Other
5.71k stars 2.45k forks source link

Remove unsetting _FILE_OFFSET_BITS #764

Closed kraj closed 9 months ago

kraj commented 1 year ago

This does not work when enabling 64bit time_t with glibc which is enabled with -D_TIME_BITS=64, since it also needs _FILE_OFFSET_BITS=64 and this does not work when its undefined explicitly

Signed-off-by: Khem Raj raj.khem@gmail.com

madler commented 9 months ago

What is it that does not work? This #undef is internal to the compilation of the gz code of zlib, where that code does not even use the time() function.

Neustradamus commented 9 months ago

@kraj: Can you look with develop branch?

thesamesam commented 9 months ago

What is it that does not work? This #undef is internal to the compilation of the gz code of zlib, where that code does not even use the time() function.

If you set _TIME_BITS=64 globally (as one should do, given it affects ABI) to opt-in to 64-bit time_t with glibc, its headers will abort if they find _FILE_OFFSET_BITS aren't used too.

madler commented 9 months ago

The code in gzguts.h is:

#  undef _FILE_OFFSET_BITS
#  undef _TIME_BITS

so, no problem.

thesamesam commented 9 months ago

Right, fixed with a566e156b3fa07b566ddbf6801b517a9dba04fa3.