]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/ceph_crypto: define __has_feature if the compiler doesn't have it 57118/head
authorXuehan Xu <xuxuehan@qianxin.com>
Sun, 28 Apr 2024 03:11:57 +0000 (11:11 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Sun, 28 Apr 2024 03:29:09 +0000 (11:29 +0800)
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 <xuxuehan@qianxin.com>
src/test/ceph_crypto.cc

index faed29b8fbce492d45dda52dae3ff6040bf515b1..50797dc2bd0f5937a57e04378b24c7faf7392440 100644 (file)
@@ -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: