]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added gzcompatibility.h
authorPrzemyslaw Skibinski <inikep@gmail.com>
Mon, 28 Nov 2016 12:25:42 +0000 (13:25 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Mon, 28 Nov 2016 12:25:42 +0000 (13:25 +0100)
zlibWrapper/gzcompatibility.h [new file with mode: 0644]
zlibWrapper/gzguts.h

diff --git a/zlibWrapper/gzcompatibility.h b/zlibWrapper/gzcompatibility.h
new file mode 100644 (file)
index 0000000..d6e83a7
--- /dev/null
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2016-present, Przemyslaw Skibinski, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#if ZLIB_VERNUM == 0x1260 && !defined(_LARGEFILE64_SOURCE)
+  //  #define _LARGEFILE64_SOURCE 0
+#endif
+
+#if ZLIB_VERNUM <= 0x1240
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); 
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+#if !defined(_WIN32) && defined(Z_LARGE64)
+#  define z_off64_t off64_t
+#else
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
+#endif
+#endif
+
+
+#if ZLIB_VERNUM <= 0x1250
+struct gzFile_s {
+    unsigned have;
+    unsigned char *next;
+    z_off64_t pos;
+};
+#endif
+
+
+#if ZLIB_VERNUM <= 0x1270
+#if defined(_WIN32) && !defined(Z_SOLO)
+#    include <stddef.h>         /* for wchar_t */ 
+ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
+                                            const char *mode));
+#endif
+#endif
index da66159a311bb0a7c47d0fda16fe7b62105333ca..c7ccc84a29d8bfe93e78967ede7edf21a1f4f655 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include "zstd_zlibwrapper.h"
+#include "gzcompatibility.h"
 #ifdef STDC
 #  include <string.h>
 #  include <stdlib.h>