From 10daf0d4d7815447799d555d04d30325836e1d44 Mon Sep 17 00:00:00 2001 From: Mark Adler <madler@alumni.caltech.edu> Date: Sun, 11 Sep 2011 11:04:49 -0700 Subject: zlib 1.2.5.1 --- gzwrite.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gzwrite.c') diff --git a/gzwrite.c b/gzwrite.c index e8defc6..0ea2994 100644 --- a/gzwrite.c +++ b/gzwrite.c @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004, 2005, 2010 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -274,7 +274,7 @@ int ZEXPORT gzputs(file, str) return ret == 0 && len != 0 ? -1 : ret; } -#ifdef STDC +#if defined(STDC) || defined(Z_HAVE_STDARG_H) #include <stdarg.h> /* -- see zlib.h -- */ @@ -346,7 +346,7 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...) return len; } -#else /* !STDC */ +#else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, @@ -366,6 +366,10 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, state = (gz_statep)file; strm = &(state->strm); + /* check that can really pass pointer in ints */ + if (sizeof(int) != sizeof(void *)) + return 0; + /* check that we're writing and that there's no error */ if (state->mode != GZ_WRITE || state->err != Z_OK) return 0; -- cgit v1.2.3-55-g6feb