From: inikep Date: Fri, 5 Aug 2016 09:04:32 +0000 (+0200) Subject: fix warnings during C++ compilation with Visual Studio X-Git-Tag: v0.8.1^2~22^2~1^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cde2d971bf017d0b1a04707ed01b87fe800fcb6;p=thirdparty%2Fzstd.git fix warnings during C++ compilation with Visual Studio --- diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 958d63692..052ccd601 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -77,6 +77,7 @@ # include /* For Visual 2005 */ # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ # pragma warning(disable : 4324) /* disable: C4324: padded structure */ +# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */ #else # ifdef __GNUC__ # define FORCE_INLINE static inline __attribute__((always_inline)) diff --git a/lib/legacy/zstd_v02.c b/lib/legacy/zstd_v02.c index 2d4cfa59c..be8476710 100644 --- a/lib/legacy/zstd_v02.c +++ b/lib/legacy/zstd_v02.c @@ -44,6 +44,10 @@ extern "C" { /****************************************** * Compiler-specific ******************************************/ +#if defined(_MSC_VER) /* Visual Studio */ +# include /* _byteswap_ulong */ +# include /* _byteswap_* */ +#endif #if defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) # define ERR_STATIC static inline #elif defined(_MSC_VER) diff --git a/lib/legacy/zstd_v03.c b/lib/legacy/zstd_v03.c index f06b47fdc..86b8138ef 100644 --- a/lib/legacy/zstd_v03.c +++ b/lib/legacy/zstd_v03.c @@ -44,6 +44,10 @@ extern "C" { /****************************************** * Compiler-specific ******************************************/ +#if defined(_MSC_VER) /* Visual Studio */ +# include /* _byteswap_ulong */ +# include /* _byteswap_* */ +#endif #if defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) # define ERR_STATIC static inline #elif defined(_MSC_VER) diff --git a/lib/legacy/zstd_v04.c b/lib/legacy/zstd_v04.c index 66a47e7a1..9fb07caaf 100644 --- a/lib/legacy/zstd_v04.c +++ b/lib/legacy/zstd_v04.c @@ -87,6 +87,10 @@ extern "C" { /****************************************** * Compiler-specific ******************************************/ +#if defined(_MSC_VER) /* Visual Studio */ +# include /* _byteswap_ulong */ +# include /* _byteswap_* */ +#endif #if defined(__GNUC__) # define MEM_STATIC static __attribute__((unused)) #elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) diff --git a/lib/legacy/zstd_v06.c b/lib/legacy/zstd_v06.c index ce6967eb8..aad3d13d7 100644 --- a/lib/legacy/zstd_v06.c +++ b/lib/legacy/zstd_v06.c @@ -85,6 +85,10 @@ extern "C" { /*-**************************************** * Compiler specifics ******************************************/ +#if defined(_MSC_VER) /* Visual Studio */ +# include /* _byteswap_ulong */ +# include /* _byteswap_* */ +#endif #if defined(__GNUC__) # define MEM_STATIC static __attribute__((unused)) #elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) diff --git a/lib/legacy/zstd_v07.c b/lib/legacy/zstd_v07.c index d95fd438e..fb4d65b86 100644 --- a/lib/legacy/zstd_v07.c +++ b/lib/legacy/zstd_v07.c @@ -3373,6 +3373,7 @@ static const ZSTDv07_customMem defaultCustomMem = { ZSTDv07_defaultAllocFunction # include /* For Visual 2005 */ # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ # pragma warning(disable : 4324) /* disable: C4324: padded structure */ +# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */ #else # ifdef __GNUC__ # define FORCE_INLINE static inline __attribute__((always_inline))