zlib does not use time_t, so _TIME_BITS is irrelevant. However it
may be defined anyway as part of a sledgehammer indiscriminately
applied to all builds.
C2X has removed K&R definitions from the C function syntax.
Though the standard has not yet been approved, some high-profile
compilers are now issuing warnings when such definitions are
encountered.
More than a decade later, Microsoft C does not support the C99
standard. It's good that _snprintf has a different name, since it
does not guarantee that the result is null terminated, as does
snprintf. However where _snprintf is used under Microsoft C, the
destination string is assured to be long enough, so this will not
be a problem. This occurs in two places, both in gzlib.c. Where
sprintf functionality is needed by gzprintf, vsnprintf is used in
the case of Microsoft C.
SunOS 4.1 claims that it is __STDC__, but it does not have strerror
in string.h. Instead of using __STDC__, this puts a direct test
for strerror in configure, and uses that information in gzguts.h.
Before, gzeof() would return true (accurately) when the last read request
went just up to the end of the uncompressed data. In the analogous case,
feof() would return false, only returning true when a read request goes
past the end of the file. This patch corrects gzeof() to behave in the
same way as feof(), as noted in the zlib.h documentation.
gzwrite.c had hard-coded parameters to deflateInit2() which could
contradict compile-time options for the use of less memory and fewer
code bits. This patch suggested by Karsten Saunte fixes that.
This also moves some of the same from zconf.h to gzguts.h. A new
function, gzflags(), was created to pass the compilation flags
related to vsnprintf usage back to zlibCompileFlags() in zutil.c.
In the process, various compiler configuration files were updated
to include gzflags(), as well as the new gzgetc_() function added
when the gzgetc() macro was introduced in a previous patch.