aboutsummaryrefslogtreecommitdiff
path: root/dep/zlib/gzguts.h
diff options
context:
space:
mode:
authorNayd <dnpd.dd@gmail.com>2014-12-24 17:45:29 +0000
committerNayd <dnpd.dd@gmail.com>2014-12-24 17:45:29 +0000
commit09f57db03d352a12d18d06a9c1616045f233dc4d (patch)
tree42859cfd2326884b3325345b96f21b2cb1136ebb /dep/zlib/gzguts.h
parent33a492e822425506884f5ca3d3baef8d5d7d94d7 (diff)
Dep/zlib: Update zlib from version 1.2.7 to 1.2.8
"Version 1.2.8 fixes a very rare bug in decompression. All users are encouraged to upgrade immediately. Version 1.2.8 also has these improvements: Add new inflateGetDictionary() function Fix bug where gzopen() immediately followed by gzclose() would write an empty file instead of an empty gzip stream. Fix bug in gzclose() when gzwrite() runs out of memory"
Diffstat (limited to 'dep/zlib/gzguts.h')
-rw-r--r--dep/zlib/gzguts.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/dep/zlib/gzguts.h b/dep/zlib/gzguts.h
index ee3f281aa57..d87659d0319 100644
--- a/dep/zlib/gzguts.h
+++ b/dep/zlib/gzguts.h
@@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -35,6 +35,13 @@
# include <io.h>
#endif
+#ifdef WINAPI_FAMILY
+# define open _open
+# define read _read
+# define write _write
+# define close _close
+#endif
+
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
@@ -60,7 +67,7 @@
#ifndef HAVE_VSNPRINTF
# ifdef MSDOS
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
+ but for now we just assume it doesn't. */
# define NO_vsnprintf
# endif
# ifdef __TURBOC__
@@ -88,6 +95,14 @@
# endif
#endif
+/* unlike snprintf (which is required in C99, yet still not supported by
+ Microsoft more than a decade later!), _snprintf does not guarantee null
+ termination of the result -- however this is only used in gzlib.c where
+ the result is assured to fit in the space provided */
+#ifdef _MSC_VER
+# define snprintf _snprintf
+#endif
+
#ifndef local
# define local static
#endif
@@ -127,7 +142,8 @@
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
-/* default i/o buffer size -- double this for output when reading */
+/* default i/o buffer size -- double this for output when reading (this and
+ twice this must be able to fit in an unsigned type) */
#define GZBUFSIZE 8192
/* gzip modes, also provide a little integrity check on the passed structure */