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.
pull/3/head^2
Mark Adler 13 years ago
parent a8d23bb675
commit 55b8b5fec1
  1. 1
      as400/bndsrc
  2. 2
      as400/zlib.inc
  3. 1
      contrib/vstudio/vc10/zlibvc.def
  4. 1
      contrib/vstudio/vc9/zlibvc.def
  5. 31
      gzwrite.c
  6. 1
      win32/zlib.def
  7. 1
      zconf.h
  8. 1
      zconf.h.cmakein
  9. 1
      zconf.h.in
  10. 3
      zlib.h
  11. 1
      zlib.map
  12. 29
      zutil.c

@ -195,7 +195,6 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
/********************************************************************/
EXPORT SYMBOL("gzgetc_")
EXPORT SYMBOL("gzflags")
/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */

@ -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

@ -132,6 +132,5 @@ EXPORTS
; zlib1 v1.2.6 added:
gzgetc_ @161
gzflags @162
inflateResetKeep @163
deflateResetKeep @164

@ -132,6 +132,5 @@ EXPORTS
; zlib1 v1.2.6 added:
gzgetc_ @161
gzflags @162
inflateResetKeep @163
deflateResetKeep @164

@ -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;
}

@ -81,4 +81,3 @@ EXPORTS
inflateResetKeep
deflateResetKeep
gzgetc_
gzflags

@ -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_

@ -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_

@ -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_

@ -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
}

@ -73,7 +73,6 @@ ZLIB_1.2.5.1 {
ZLIB_1.2.5.2 {
deflateResetKeep;
gzflags;
gzgetc_;
inflateResetKeep;
} ZLIB_1.2.5.1;

@ -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

Loading…
Cancel
Save