]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix zlibWrapper for Visual Studio 1847/head
authorYann Collet <cyan@fb.com>
Thu, 24 Oct 2019 22:19:05 +0000 (15:19 -0700)
committerYann Collet <cyan@fb.com>
Thu, 24 Oct 2019 22:19:05 +0000 (15:19 -0700)
As per https://github.com/facebook/zstd/issues/1800#issuecomment-545945050,
Visual does not support `ssize_t` type,
which is an issue for `gzread.c`.

Added a work around, suggested by @bluenlive

Note : I have not been able to confirm the problem,
so this is a blind fix.
This seems safe outside of Visual, since it is gated by _MSC_VER macro.

zlibWrapper/gzread.c

index bcac9700d664c30bdf1838482d3640413624e24a..359d178891307a387b008d309037621cb967bd57 100644 (file)
@@ -8,6 +8,14 @@
 
 #include "gzguts.h"
 
+/* fix for Visual Studio, which doesn't support ssize_t type.
+ * see https://github.com/facebook/zstd/issues/1800#issuecomment-545945050 */
+#if defined(_MSC_VER) && !defined(ssize_t)
+#  include <BaseTsd.h>
+   typedef SSIZE_T ssize_t;
+#endif
+
+
 /* Local functions */
 local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
 local int gz_avail OF((gz_statep));