aboutsummaryrefslogtreecommitdiff
path: root/gzwrite.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-10-02 11:15:00 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-10-02 11:15:00 -0700
commit00c836e325a07419f5d855e2f275500a37cb27d2 (patch)
tree1b4ef187059c19ee142f6c61952133b50a295136 /gzwrite.c
parent0956bd23dd070074ec572fd5557a74ff29797b2f (diff)
downloadzlib-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.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gzwrite.c b/gzwrite.c
index 8eeca4e..1d28807 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -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 */
541unsigned 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}