From 882a41541f6d60bbc3e416cbaa47ed140455d43c Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Thu, 30 Jan 2025 21:24:18 +0100 Subject: [PATCH] adding patch for sol2 3.3.0 --- packages/s/sol2/patches/3.3.0/optional.patch | 14 ++++++++++++++ packages/s/sol2/xmake.lua | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 packages/s/sol2/patches/3.3.0/optional.patch diff --git a/packages/s/sol2/patches/3.3.0/optional.patch b/packages/s/sol2/patches/3.3.0/optional.patch new file mode 100644 index 00000000000..815326b6956 --- /dev/null +++ b/packages/s/sol2/patches/3.3.0/optional.patch @@ -0,0 +1,14 @@ +diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp +index 26f41d0c..e22226d6 100644 +--- a/include/sol/optional_implementation.hpp ++++ b/include/sol/optional_implementation.hpp +@@ -2191,7 +2191,8 @@ namespace sol { + static_assert(std::is_constructible::value, "T must be constructible with Args"); + + *this = nullopt; +- this->construct(std::forward(args)...); ++ new (static_cast(this)) optional(std::in_place, std::forward(args)...); ++ return **this; + } + + /// Swaps this optional with the other. diff --git a/packages/s/sol2/xmake.lua b/packages/s/sol2/xmake.lua index 5828ed6ff46..127684a37c6 100644 --- a/packages/s/sol2/xmake.lua +++ b/packages/s/sol2/xmake.lua @@ -14,6 +14,8 @@ package("sol2") add_configs("includes_lua", {description = "Should this package includes the Lua package (set to false if you're shipping a custom Lua)", default = true, type = "boolean"}) + add_patches(">=3.3.0", path.join(os.scriptdir(), "patches", "3.3.0", "optional.patch"), "8440f25e5dedc29229c3def85aa6f24e0eb165d4c390fd0e1312452a569a01a6") + if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::sol2") elseif is_plat("linux") then