diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-10-02 11:15:00 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-10-02 11:15:00 -0700 |
commit | 00c836e325a07419f5d855e2f275500a37cb27d2 (patch) | |
tree | 1b4ef187059c19ee142f6c61952133b50a295136 /gzwrite.c | |
parent | 0956bd23dd070074ec572fd5557a74ff29797b2f (diff) | |
download | zlib-00c836e325a07419f5d855e2f275500a37cb27d2.tar.gz zlib-00c836e325a07419f5d855e2f275500a37cb27d2.tar.bz2 zlib-00c836e325a07419f5d855e2f275500a37cb27d2.zip |
Merge vestigial vsnprintf determination from zutil.h to gzguts.h.
This also moves some of the same from zconf.h to gzguts.h. A new
function, gzflags(), was created to pass the compilation flags
related to vsnprintf usage back to zlibCompileFlags() in zutil.c.
In the process, various compiler configuration files were updated
to include gzflags(), as well as the new gzgetc_() function added
when the gzgetc() macro was introduced in a previous patch.
Diffstat (limited to 'gzwrite.c')
-rw-r--r-- | gzwrite.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -536,3 +536,34 @@ int ZEXPORT gzclose_w(file) | |||
536 | free(state); | 536 | free(state); |
537 | return ret; | 537 | return ret; |
538 | } | 538 | } |
539 | |||
540 | /* used by zlibVersion() to get the vsnprintf story from the horse's mouth */ | ||
541 | unsigned long ZEXPORT gzflags() | ||
542 | { | ||
543 | unsigned long flags = 0; | ||
544 | #if defined(STDC) || defined(Z_HAVE_STDARG_H) | ||
545 | # ifdef NO_vsnprintf | ||
546 | flags += 1L << 25; | ||
547 | # ifdef HAS_vsprintf_void | ||
548 | flags += 1L << 26; | ||
549 | # endif | ||
550 | # else | ||
551 | # ifdef HAS_vsnprintf_void | ||
552 | flags += 1L << 26; | ||
553 | # endif | ||
554 | # endif | ||
555 | #else | ||
556 | flags += 1L << 24; | ||
557 | # ifdef NO_snprintf | ||
558 | flags += 1L << 25; | ||
559 | # ifdef HAS_sprintf_void | ||
560 | flags += 1L << 26; | ||
561 | # endif | ||
562 | # else | ||
563 | # ifdef HAS_snprintf_void | ||
564 | flags += 1L << 26; | ||
565 | # endif | ||
566 | # endif | ||
567 | #endif | ||
568 | return flags; | ||
569 | } | ||