From 952427aebfbcb46299fa39ef1347d67929c2b3b4 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Thu, 30 Apr 2020 17:20:40 -0400 Subject: [PATCH] Avoid inline Keyword in C90 Previously we would use it for all gcc-like compilations, even when a restrictive mode that disallowed it had been selected. --- lib/common/compiler.h | 2 +- lib/common/xxhash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 2f18efb0a..95e948352 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -17,7 +17,7 @@ /* force inlining */ #if !defined(ZSTD_NO_INLINE) -#if defined (__GNUC__) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ # define INLINE_KEYWORD inline #else # define INLINE_KEYWORD diff --git a/lib/common/xxhash.c b/lib/common/xxhash.c index 429a869e9..72314c59f 100644 --- a/lib/common/xxhash.c +++ b/lib/common/xxhash.c @@ -95,7 +95,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcp /* ************************************* * Compiler Specific Options ***************************************/ -#if defined (__GNUC__) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ # define INLINE_KEYWORD inline #else # define INLINE_KEYWORD