Skip to content

Commit

Permalink
adding patch for sol2 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kbz-8 committed Jan 30, 2025
1 parent 4b0acbe commit 882a415
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/s/sol2/patches/3.3.0/optional.patch
Original file line number Diff line number Diff line change
@@ -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<T, Args&&...>::value, "T must be constructible with Args");

*this = nullopt;
- this->construct(std::forward<Args>(args)...);
+ new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
+ return **this;
}

/// Swaps this optional with the other.
2 changes: 2 additions & 0 deletions packages/s/sol2/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 882a415

Please sign in to comment.