aboutsummaryrefslogtreecommitdiff
path: root/zutil.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-02-01 23:25:34 -0800
committerMark Adler <madler@alumni.caltech.edu>2012-02-01 23:25:34 -0800
commit55b8b5fec16503cb9ce26074f600a1d7b426a0cc (patch)
tree7e14662a33ffd8141e9a794329aa0a731250f486 /zutil.c
parenta8d23bb675e05cfc0cc70ddc8ea03dbbf0e49fb8 (diff)
downloadzlib-55b8b5fec16503cb9ce26074f600a1d7b426a0cc.tar.gz
zlib-55b8b5fec16503cb9ce26074f600a1d7b426a0cc.tar.bz2
zlib-55b8b5fec16503cb9ce26074f600a1d7b426a0cc.zip
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.
Diffstat (limited to 'zutil.c')
-rw-r--r--zutil.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/zutil.c b/zutil.c
index 8a1d242..12517b4 100644
--- a/zutil.c
+++ b/zutil.c
@@ -6,6 +6,9 @@
6/* @(#) $Id$ */ 6/* @(#) $Id$ */
7 7
8#include "zutil.h" 8#include "zutil.h"
9#ifndef Z_SOLO
10# include "gzguts.h"
11#endif
9 12
10#ifndef NO_DUMMY_DECL 13#ifndef NO_DUMMY_DECL
11struct internal_state {int dummy;}; /* for buggy compilers */ 14struct internal_state {int dummy;}; /* for buggy compilers */
@@ -85,11 +88,31 @@ uLong ZEXPORT zlibCompileFlags()
85#ifdef FASTEST 88#ifdef FASTEST
86 flags += 1L << 21; 89 flags += 1L << 21;
87#endif 90#endif
88#ifdef Z_SOLO 91#if defined(STDC) || defined(Z_HAVE_STDARG_H)
89 return flags; 92# ifdef NO_vsnprintf
93 flags += 1L << 25;
94# ifdef HAS_vsprintf_void
95 flags += 1L << 26;
96# endif
97# else
98# ifdef HAS_vsnprintf_void
99 flags += 1L << 26;
100# endif
101# endif
90#else 102#else
91 return flags + gzflags(); 103 flags += 1L << 24;
104# ifdef NO_snprintf
105 flags += 1L << 25;
106# ifdef HAS_sprintf_void
107 flags += 1L << 26;
108# endif
109# else
110# ifdef HAS_snprintf_void
111 flags += 1L << 26;
112# endif
113# endif
92#endif 114#endif
115 return flags;
93} 116}
94 117
95#ifdef DEBUG 118#ifdef DEBUG