From: Christopher Blum Date: Sat, 14 Jul 2018 15:01:59 +0000 (+0200) Subject: include: fix build with older clang X-Git-Tag: v13.2.1~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dae252749075bad7b91cae66fa786d1bfc716c6b;p=ceph.git 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 --- diff --git a/src/common/convenience.h b/src/common/convenience.h index e95fafe849a8..9dc2ed1b4229 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