From 99c918ed8af96c396fb48ea28633e97e9db98adb Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 17 Apr 2024 09:41:30 +0200 Subject: [PATCH] BUILD: xxhash: silence a build warning on Solaris + gcc-5.5 Testing an undefined macro emits warnings due to -Wundef, and we have exactly one such case in xxhash: include/import/xxhash.h:3390:42: warning: "__cplusplus" is not defined [-Wundef] #if ((defined(sun) || defined(__sun)) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */ Let's just prepend "defined(__cplusplus) &&" before __cplusplus to resolve the problem. Upstream is still affected apparently. --- include/import/xxhash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/import/xxhash.h b/include/import/xxhash.h index a18e8c762..7c3c3fcba 100644 --- a/include/import/xxhash.h +++ b/include/import/xxhash.h @@ -3387,7 +3387,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_can /* === Compiler specifics === */ -#if ((defined(sun) || defined(__sun)) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */ +#if ((defined(sun) || defined(__sun)) && defined(__cplusplus) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */ # define XXH_RESTRICT /* disable */ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* >= C99 */ # define XXH_RESTRICT restrict