From: Mark Adler Date: Thu, 2 Feb 2012 07:25:34 +0000 (-0800) Subject: Put gzflags() functionality back in zutil.c. X-Git-Tag: upstream/1.2.8~146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55b8b5fec16503cb9ce26074f600a1d7b426a0cc;p=platform%2Fupstream%2Fzlib.git 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. --- diff --git a/as400/bndsrc b/as400/bndsrc index d048dbb..52cc661 100644 --- a/as400/bndsrc +++ b/as400/bndsrc @@ -195,7 +195,6 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') /********************************************************************/ EXPORT SYMBOL("gzgetc_") - EXPORT SYMBOL("gzflags") /********************************************************************/ /* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */ diff --git a/as400/zlib.inc b/as400/zlib.inc index a5838cb..2671c87 100644 --- a/as400/zlib.inc +++ b/as400/zlib.inc @@ -442,6 +442,4 @@ D PR 10I 0 extproc('deflateResetKeep') End and init. stream D strm like(z_stream) Expansion stream * - D gzflags PR 10U 0 extproc('gzflags') - * /endif diff --git a/contrib/vstudio/vc10/zlibvc.def b/contrib/vstudio/vc10/zlibvc.def index 571b0a6..b4bb8f6 100644 --- a/contrib/vstudio/vc10/zlibvc.def +++ b/contrib/vstudio/vc10/zlibvc.def @@ -132,6 +132,5 @@ EXPORTS ; zlib1 v1.2.6 added: gzgetc_ @161 - gzflags @162 inflateResetKeep @163 deflateResetKeep @164 diff --git a/contrib/vstudio/vc9/zlibvc.def b/contrib/vstudio/vc9/zlibvc.def index 571b0a6..b4bb8f6 100644 --- a/contrib/vstudio/vc9/zlibvc.def +++ b/contrib/vstudio/vc9/zlibvc.def @@ -132,6 +132,5 @@ EXPORTS ; zlib1 v1.2.6 added: gzgetc_ @161 - gzflags @162 inflateResetKeep @163 deflateResetKeep @164 diff --git a/gzwrite.c b/gzwrite.c index caa35b6..3b24b84 100644 --- a/gzwrite.c +++ b/gzwrite.c @@ -560,34 +560,3 @@ int ZEXPORT gzclose_w(file) free(state); return ret; } - -/* used by zlibVersion() to get the vsnprintf story from the horse's mouth */ -unsigned long ZEXPORT gzflags() -{ - unsigned long flags = 0; -#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 - 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; -} diff --git a/win32/zlib.def b/win32/zlib.def index d96c18a..a2a2081 100644 --- a/win32/zlib.def +++ b/win32/zlib.def @@ -81,4 +81,3 @@ EXPORTS inflateResetKeep deflateResetKeep gzgetc_ - gzflags diff --git a/zconf.h b/zconf.h index 71adb18..7c7e798 100644 --- a/zconf.h +++ b/zconf.h @@ -65,7 +65,6 @@ # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror -# define gzflags z_gzflags # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ diff --git a/zconf.h.cmakein b/zconf.h.cmakein index 325f93c..c299fb1 100644 --- a/zconf.h.cmakein +++ b/zconf.h.cmakein @@ -67,7 +67,6 @@ # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror -# define gzflags z_gzflags # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ diff --git a/zconf.h.in b/zconf.h.in index 71adb18..7c7e798 100644 --- a/zconf.h.in +++ b/zconf.h.in @@ -65,7 +65,6 @@ # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror -# define gzflags z_gzflags # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ diff --git a/zlib.h b/zlib.h index 72252b5..bab908a 100644 --- a/zlib.h +++ b/zlib.h @@ -1727,9 +1727,6 @@ ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#ifndef Z_SOLO - ZEXTERN unsigned long ZEXPORT gzflags OF((void)); -#endif #ifdef __cplusplus } diff --git a/zlib.map b/zlib.map index 54fa553..771f420 100644 --- a/zlib.map +++ b/zlib.map @@ -73,7 +73,6 @@ ZLIB_1.2.5.1 { ZLIB_1.2.5.2 { deflateResetKeep; - gzflags; gzgetc_; inflateResetKeep; } ZLIB_1.2.5.1; 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