From 99d46e343d9b353b5d1f2c701994911a23d65e0d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 11 Dec 2025 11:29:33 +0100 Subject: [PATCH] LuaWrapper: Fix C++11 compatibility Signed-off-by: Remi Gacogne --- ext/luawrapper/include/LuaContext.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index 97530a52ef..90246dfef1 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -38,7 +38,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include #include #include #include @@ -47,7 +46,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include #include #include #include @@ -57,6 +55,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#if __cplusplus >= 201703L +#include +#include +#endif /* C++17 */ + // Set the older gcc define for tsan if clang or modern gcc tell us we have tsan. #if defined(__has_feature) #if __has_feature(thread_sanitizer) @@ -2002,8 +2005,10 @@ struct LuaContext::FunctionArgumentsCounter<> { // implementation of IsOptional template struct LuaContext::IsOptional> : public std::true_type {}; +#if __cplusplus >= 201703L template struct LuaContext::IsOptional> : public std::true_type {}; +#endif /* C++ 17 */ // implementation of LuaFunctionCaller template @@ -2557,6 +2562,7 @@ private: }; }; +#if __cplusplus >= 201703L // std::variant template struct LuaContext::Pusher> @@ -2573,6 +2579,7 @@ struct LuaContext::Pusher> return obj; } }; +#endif /* C++17 */ // boost::optional template @@ -2593,6 +2600,7 @@ struct LuaContext::Pusher> { } }; +#if __cplusplus >= 201703L // std::optional template struct LuaContext::Pusher> { @@ -2611,6 +2619,7 @@ struct LuaContext::Pusher> { } } }; +#endif /* C++17 */ // tuple template @@ -2961,6 +2970,7 @@ struct LuaContext::Reader> } }; +#if __cplusplus >= 201703L // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks) template struct LuaContext::Reader> @@ -2978,6 +2988,7 @@ struct LuaContext::Reader> } }; // NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) +#endif /* C++ 17 */ // boost::variant template @@ -3026,6 +3037,7 @@ public: } }; +#if __cplusplus >= 201703L // std::variant template struct LuaContext::Reader> @@ -3059,6 +3071,7 @@ public: return variantRead(state, index); } }; +#endif /* C++ 17 */ // reading a tuple // tuple have an additional argument for their functions, that is the maximum size to read -- 2.47.3