From: Willy Tarreau Date: Wed, 17 Apr 2024 07:41:30 +0000 (+0200) Subject: BUILD: xxhash: silence a build warning on Solaris + gcc-5.5 X-Git-Tag: v3.0-dev8~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99c918ed8af96c396fb48ea28633e97e9db98adb;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/import/xxhash.h b/include/import/xxhash.h index a18e8c762d..7c3c3fcbab 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