From: Xuehan Xu Date: Sun, 28 Apr 2024 03:11:57 +0000 (+0800) Subject: test/ceph_crypto: define __has_feature if the compiler doesn't have it X-Git-Tag: v20.0.0~2071^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3190c02436c810c9988c5e03b13533a734a56679;p=ceph.git test/ceph_crypto: define __has_feature if the compiler doesn't have it Refer to https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005ffeature.html and https://clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension for further information Fixes: https://tracker.ceph.com/issues/65673 Signed-off-by: Xuehan Xu --- diff --git a/src/test/ceph_crypto.cc b/src/test/ceph_crypto.cc index faed29b8fbce4..50797dc2bd0f5 100644 --- a/src/test/ceph_crypto.cc +++ b/src/test/ceph_crypto.cc @@ -269,6 +269,11 @@ void do_simple_crypto() { } #if GTEST_HAS_DEATH_TEST && !defined(_WIN32) + +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + TEST_F(ForkDeathTest, MD5) { #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) // sanitizer warns like: