From: Alexander Lobakin Date: Fri, 24 Sep 2021 19:50:37 +0000 (+0200) Subject: [contrib][linux] Fix -Wundef inside Linux kernel tree X-Git-Tag: v1.5.1~1^2~86^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2802%2Fhead;p=thirdparty%2Fzstd.git [contrib][linux] Fix -Wundef inside Linux kernel tree Commit d7ef97a013b5 ("[build] Fix oss-fuzz build with the dataflow sanitizer") broke build inside Linux-kernel after 'import', as it no longer can conditionally remove ZSTD_MEMORY_SANITIZER definition from the #if DEF_A || DEF_B block. This emits -Wundef warning which can be treated as error. Split this preprocessor condition into two separate conditions to fix this. Fixes: d7ef97a013b5 ("[build] Fix oss-fuzz build with the dataflow sanitizer") Signed-off-by: Alexander Lobakin --- diff --git a/lib/decompress/huf_decompress.c b/lib/decompress/huf_decompress.c index 128b08019..9f711f39e 100644 --- a/lib/decompress/huf_decompress.c +++ b/lib/decompress/huf_decompress.c @@ -47,11 +47,13 @@ * Disable when MSAN is enabled. */ #if defined(__linux__) || defined(__linux) || defined(__APPLE__) -# if ZSTD_MEMORY_SANITIZER || ZSTD_DATAFLOW_SANITIZER +# if ZSTD_MEMORY_SANITIZER +# define HUF_ASM_SUPPORTED 0 +# elif ZSTD_DATAFLOW_SANITIZER # define HUF_ASM_SUPPORTED 0 # else # define HUF_ASM_SUPPORTED 1 -#endif +# endif #else # define HUF_ASM_SUPPORTED 0 #endif