summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/zlib/src/gzclose.c
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2017-06-24 00:11:01 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-04 08:36:22 +0000
commit5169d588a599036aa1962f518a7c321f5e3e7296 (patch)
tree4268ab94056c9e476b4ae1e73bd88a87975141d4 /src/3rdparty/zlib/src/gzclose.c
parent959cc53b618b632d1c768f561c68e0b23b85335f (diff)
Update bundled zlib to version 1.2.11
Also clean up some unused files. The remaining diff to clean 1.2.11 is archived in the qtpatches.diff file. [ChangeLog][Third-Party Code] zlib was updated to version 1.2.11. Task-number: QTBUG-31020 Change-Id: I89f890904af48c6e9ba6eabc5d58f5adbe2c53f0 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/3rdparty/zlib/src/gzclose.c')
-rw-r--r--src/3rdparty/zlib/src/gzclose.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/3rdparty/zlib/src/gzclose.c b/src/3rdparty/zlib/src/gzclose.c
new file mode 100644
index 0000000000..caeb99a317
--- /dev/null
+++ b/src/3rdparty/zlib/src/gzclose.c
@@ -0,0 +1,25 @@
+/* gzclose.c -- zlib gzclose() function
+ * Copyright (C) 2004, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* gzclose() is in a separate file so that it is linked in only if it is used.
+ That way the other gzclose functions can be used instead to avoid linking in
+ unneeded compression or decompression routines. */
+int ZEXPORT gzclose(file)
+ gzFile file;
+{
+#ifndef NO_GZCOMPRESS
+ gz_statep state;
+
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
+#else
+ return gzclose_r(file);
+#endif
+}