From: Oleg Smirnov Date: Fri, 22 Jan 2021 11:16:14 +0000 (+0300) Subject: Fix #1486: build fails on Windows with VS2013 toolset (v120) X-Git-Tag: v3.5.2~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6700dbaed29e87086c2cf17b03bc7f95247cfb0;p=thirdparty%2Flibarchive.git Fix #1486: build fails on Windows with VS2013 toolset (v120) Build fails on compiling xxhash.c having a fuction with "inline" specifier. "inline" is a c99 keyword and c99 is not yet (fully) supported with MSVC toolset v120: "The inline keyword is available only in C++. The __inline and __forceinline keywords are available in both C and C++. For compatibility with previous versions, _inline is a synonym for __inline." (Source: http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx) This fix adds a patch that replaces "inline" with "__inline" in xxhash.c --- diff --git a/libarchive/xxhash.c b/libarchive/xxhash.c index 70750bae0..f96e9d934 100644 --- a/libarchive/xxhash.c +++ b/libarchive/xxhash.c @@ -150,7 +150,11 @@ typedef struct _U32_S { U32 v; } _PACKED U32_S; #if GCC_VERSION >= 409 __attribute__((__no_sanitize_undefined__)) #endif -static inline U32 A32(const void * x) +#if defined(_MSC_VER) +static __inline U32 A32(const void * x) +#else +static inline U32 A32(const void* x) +#endif { return (((const U32_S *)(x))->v); }