]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[contrib][linux] Fix -Wundef inside Linux kernel tree 2802/head
authorAlexander Lobakin <alobakin@pm.me>
Fri, 24 Sep 2021 19:50:37 +0000 (21:50 +0200)
committerAlexander Lobakin <alobakin@pm.me>
Sat, 25 Sep 2021 11:35:25 +0000 (13:35 +0200)
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 <alobakin@pm.me>
lib/decompress/huf_decompress.c

index 128b08019c480c536d717daf9b52f9e677c438db..9f711f39e7815aaa9f6c0211e5a45a8aab02bb4e 100644 (file)
  * 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