From: Nathan Moinvaziri Date: Sun, 24 May 2020 19:17:32 +0000 (-0700) Subject: Fix storechunk for MSVC ARM. X-Git-Tag: 1.9.9-b1~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdaf12e103690e07fef1016e82c59b996b78dc47;p=thirdparty%2Fzlib-ng.git Fix storechunk for MSVC ARM. --- diff --git a/memcopy.h b/memcopy.h index 6589daa6..b3742c9c 100644 --- a/memcopy.h +++ b/memcopy.h @@ -50,7 +50,13 @@ static inline inffast_chunk_t loadchunk(unsigned char const* s) { instruction appropriate for the inffast_chunk_t type. */ static inline void storechunk(unsigned char* d, inffast_chunk_t c) { +#ifdef _MSC_VER + /* Cast to inffast_chunk_t pointer to avoid compiler error on MSVC ARM */ + inffast_chunk_t *dst_chunk = (inffast_chunk_t *)d; + memcpy(dst_chunk, &c, sizeof(c)); +#else memcpy(d, &c, sizeof(c)); +#endif } /*