From db5ac2dc15f0ac607c03416e538ae2ffc5482467 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 28 Feb 2024 09:21:15 +0100 Subject: [PATCH] Utils: Fix build on macOS < 13 with C++20 The Clang implementation of span is incomplete until LLVM 15 / Xcode 15 / macOS 13.5 Change-Id: Iac8514fc84643cb4dae9cfaac603df5e798f9ff4 Reviewed-by: Marco Bubke Reviewed-by: --- src/libs/utils/span.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/span.h b/src/libs/utils/span.h index b1fba814472..d21bb9ab00b 100644 --- a/src/libs/utils/span.h +++ b/src/libs/utils/span.h @@ -5,7 +5,9 @@ #include -#if __cplusplus >= 202002L +// The (Apple) Clang implementation of span is incomplete until LLVM 15 / Xcode 14.3 / macOS 13 +#if __cplusplus >= 202002L \ + && !(defined(__apple_build_version__) && __apple_build_version__ < 14030022) #include namespace Utils { @@ -22,6 +24,11 @@ QT_WARNING_PUSH #elif defined(Q_CC_GNU) || defined(Q_CC_CLANG) #pragma GCC system_header #endif + +// disable automatic usage of std::span in span-lite +// since we make that decision ourselves at the top of this header +#define span_CONFIG_SELECT_SPAN span_SPAN_NONSTD + #include <3rdparty/span/span.hpp> namespace Utils { using namespace nonstd;