From dae252749075bad7b91cae66fa786d1bfc716c6b Mon Sep 17 00:00:00 2001 From: Christopher Blum Date: Sat, 14 Jul 2018 17:01:59 +0200 Subject: [PATCH] include: fix build with older clang to fix the FTBFS on clang shipped with xcode 9.1 (based on Clang 4.0). This fixes ceph client library builds for the OSX target initally targetted with PR #23034. refs: #23034 Signed-off-by: Christopher Blum --- src/common/convenience.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/convenience.h b/src/common/convenience.h index e95fafe849a8f..9dc2ed1b42293 100644 --- a/src/common/convenience.h +++ b/src/common/convenience.h @@ -32,7 +32,6 @@ #ifndef CEPH_COMMON_CONVENIENCE_H #define CEPH_COMMON_CONVENIENCE_H -#if __has_include() namespace ceph { // Lock Factories @@ -150,7 +149,6 @@ inline auto with_shared_lock(Mutex&& mutex, Fun&& fun, Args&&... args) return std::forward(fun)(std::forward(args)...); } } -#endif // __has_include() // Lock Types // ---------- @@ -205,7 +203,7 @@ auto maybe_do_or(const boost::optional& t, F&& f, U&& u) -> return std::forward(u); } - +#if __has_include() // Same thing but for std::optional template @@ -233,6 +231,8 @@ auto maybe_do_or(const std::optional& t, F&& f, U&& u) -> else return std::forward(u); } +#endif // __has_include() + namespace _convenience { template -- 2.39.5