diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-02-01 23:25:34 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-02-01 23:25:34 -0800 |
commit | 55b8b5fec16503cb9ce26074f600a1d7b426a0cc (patch) | |
tree | 7e14662a33ffd8141e9a794329aa0a731250f486 /gzwrite.c | |
parent | a8d23bb675e05cfc0cc70ddc8ea03dbbf0e49fb8 (diff) | |
download | zlib-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 'gzwrite.c')
-rw-r--r-- | gzwrite.c | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -560,34 +560,3 @@ int ZEXPORT gzclose_w(file) | |||
560 | free(state); | 560 | free(state); |
561 | return ret; | 561 | return ret; |
562 | } | 562 | } |
563 | |||
564 | /* used by zlibVersion() to get the vsnprintf story from the horse's mouth */ | ||
565 | unsigned long ZEXPORT gzflags() | ||
566 | { | ||
567 | unsigned long flags = 0; | ||
568 | #if defined(STDC) || defined(Z_HAVE_STDARG_H) | ||
569 | # ifdef NO_vsnprintf | ||
570 | flags += 1L << 25; | ||
571 | # ifdef HAS_vsprintf_void | ||
572 | flags += 1L << 26; | ||
573 | # endif | ||
574 | # else | ||
575 | # ifdef HAS_vsnprintf_void | ||
576 | flags += 1L << 26; | ||
577 | # endif | ||
578 | # endif | ||
579 | #else | ||
580 | flags += 1L << 24; | ||
581 | # ifdef NO_snprintf | ||
582 | flags += 1L << 25; | ||
583 | # ifdef HAS_sprintf_void | ||
584 | flags += 1L << 26; | ||
585 | # endif | ||
586 | # else | ||
587 | # ifdef HAS_snprintf_void | ||
588 | flags += 1L << 26; | ||
589 | # endif | ||
590 | # endif | ||
591 | #endif | ||
592 | return flags; | ||
593 | } | ||