From 55b8b5fec16503cb9ce26074f600a1d7b426a0cc Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Wed, 1 Feb 2012 23:25:34 -0800 Subject: Put gzflags() functionality back in zutil.c. gzflags() was put in gzwrite.c in order to be compiled exactly the same as gzprintf(), so that it was guaranteed to return the correct information. However that causes a static linkage to zlib to bring in many routines that are often not used. All that is required to duplicate the compilation environment of gzprintf() is to include gzguts.h. So that is now done in zutil.c to assure that the correct flags are returned. --- zutil.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'zutil.c') diff --git a/zutil.c b/zutil.c index 8a1d242..12517b4 100644 --- a/zutil.c +++ b/zutil.c @@ -6,6 +6,9 @@ /* @(#) $Id$ */ #include "zutil.h" +#ifndef Z_SOLO +# include "gzguts.h" +#endif #ifndef NO_DUMMY_DECL struct internal_state {int dummy;}; /* for buggy compilers */ @@ -85,11 +88,31 @@ uLong ZEXPORT zlibCompileFlags() #ifdef FASTEST flags += 1L << 21; #endif -#ifdef Z_SOLO - return flags; +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifdef NO_vsnprintf + flags += 1L << 25; +# ifdef HAS_vsprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_vsnprintf_void + flags += 1L << 26; +# endif +# endif #else - return flags + gzflags(); + flags += 1L << 24; +# ifdef NO_snprintf + flags += 1L << 25; +# ifdef HAS_sprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_snprintf_void + flags += 1L << 26; +# endif +# endif #endif + return flags; } #ifdef DEBUG -- cgit v1.2.3-55-g6feb