From 00c836e325a07419f5d855e2f275500a37cb27d2 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 2 Oct 2011 11:15:00 -0700 Subject: 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. --- gzwrite.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'gzwrite.c') 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) 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; +} -- cgit v1.2.3-55-g6feb