From: Yann Collet Date: Thu, 24 Oct 2019 22:19:05 +0000 (-0700) Subject: fix zlibWrapper for Visual Studio X-Git-Tag: v1.4.4~1^2~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42a22af78b068bd934123ae7e1d6eee1544282f6;p=thirdparty%2Fzstd.git fix zlibWrapper for Visual Studio 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. --- diff --git a/zlibWrapper/gzread.c b/zlibWrapper/gzread.c index bcac9700d..359d17889 100644 --- a/zlibWrapper/gzread.c +++ b/zlibWrapper/gzread.c @@ -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 + 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));