From 362c1a7ebe63792e2799e042414ab8441174d061 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 23 Jul 2025 17:35:35 +0200 Subject: [PATCH] Update sol --- extern/sol3/README.md | 7 +- extern/sol3/sol/abort.hpp | 47 + extern/sol3/sol/as_args.hpp | 2 +- extern/sol3/sol/as_returns.hpp | 2 +- extern/sol3/sol/assert.hpp | 198 +- extern/sol3/sol/base_traits.hpp | 279 +-- extern/sol3/sol/bind_traits.hpp | 10 +- extern/sol3/sol/bytecode.hpp | 242 +-- extern/sol3/sol/call.hpp | 32 +- extern/sol3/sol/compatibility.hpp | 26 +- extern/sol3/sol/compatibility/compat-5.3.c.h | 1800 ++++++++--------- extern/sol3/sol/compatibility/compat-5.3.h | 854 ++++---- extern/sol3/sol/compatibility/compat-5.4.h | 54 +- extern/sol3/sol/compatibility/lua_version.hpp | 99 +- extern/sol3/sol/config.hpp | 50 + extern/sol3/sol/coroutine.hpp | 12 +- extern/sol3/sol/debug.hpp | 115 +- extern/sol3/sol/demangle.hpp | 8 +- extern/sol3/sol/deprecate.hpp | 88 +- extern/sol3/sol/detail/build_version.hpp | 464 ++--- extern/sol3/sol/dump_handler.hpp | 154 +- extern/sol3/sol/ebco.hpp | 321 +-- extern/sol3/sol/environment.hpp | 23 +- extern/sol3/sol/epilogue.hpp | 78 +- extern/sol3/sol/error.hpp | 191 +- extern/sol3/sol/error_handler.hpp | 27 +- extern/sol3/sol/forward.hpp | 14 +- extern/sol3/sol/forward_as.hpp | 44 + extern/sol3/sol/forward_detail.hpp | 4 +- extern/sol3/sol/function.hpp | 284 +-- extern/sol3/sol/function_result.hpp | 2 +- extern/sol3/sol/function_types.hpp | 14 +- extern/sol3/sol/function_types_core.hpp | 2 +- extern/sol3/sol/function_types_overloaded.hpp | 4 +- extern/sol3/sol/function_types_stateful.hpp | 6 +- extern/sol3/sol/function_types_stateless.hpp | 44 +- extern/sol3/sol/function_types_templated.hpp | 4 +- extern/sol3/sol/in_place.hpp | 2 +- extern/sol3/sol/inheritance.hpp | 390 ++-- extern/sol3/sol/load_result.hpp | 16 +- extern/sol3/sol/lua_table.hpp | 190 +- extern/sol3/sol/lua_value.hpp | 324 +-- extern/sol3/sol/make_reference.hpp | 2 +- extern/sol3/sol/metatable.hpp | 10 +- extern/sol3/sol/object.hpp | 2 +- extern/sol3/sol/object_base.hpp | 2 +- extern/sol3/sol/optional.hpp | 12 +- extern/sol3/sol/optional_implementation.hpp | 21 +- extern/sol3/sol/overload.hpp | 4 +- extern/sol3/sol/packaged_coroutine.hpp | 524 ++--- extern/sol3/sol/pairs_iterator.hpp | 550 ++--- extern/sol3/sol/pointer_like.hpp | 205 +- extern/sol3/sol/policies.hpp | 2 +- extern/sol3/sol/prologue.hpp | 94 +- extern/sol3/sol/property.hpp | 2 +- extern/sol3/sol/protect.hpp | 2 +- extern/sol3/sol/protected_function.hpp | 20 +- extern/sol3/sol/protected_function_result.hpp | 27 +- extern/sol3/sol/protected_handler.hpp | 4 +- extern/sol3/sol/proxy_base.hpp | 2 +- extern/sol3/sol/raii.hpp | 2 +- extern/sol3/sol/reference.hpp | 26 +- extern/sol3/sol/resolve.hpp | 2 +- extern/sol3/sol/sol.hpp | 18 +- extern/sol3/sol/stack.hpp | 735 +++---- extern/sol3/sol/stack/detail/pairs.hpp | 196 +- extern/sol3/sol/stack_check.hpp | 2 +- extern/sol3/sol/stack_check_get.hpp | 2 +- extern/sol3/sol/stack_check_get_qualified.hpp | 21 +- .../sol3/sol/stack_check_get_unqualified.hpp | 8 +- extern/sol3/sol/stack_check_qualified.hpp | 4 +- extern/sol3/sol/stack_check_unqualified.hpp | 135 +- extern/sol3/sol/stack_core.hpp | 51 +- extern/sol3/sol/stack_field.hpp | 14 +- extern/sol3/sol/stack_get.hpp | 2 +- extern/sol3/sol/stack_get_qualified.hpp | 2 +- extern/sol3/sol/stack_get_unqualified.hpp | 99 +- extern/sol3/sol/stack_guard.hpp | 4 +- extern/sol3/sol/stack_iterator.hpp | 2 +- extern/sol3/sol/stack_pop.hpp | 2 +- extern/sol3/sol/stack_probe.hpp | 4 +- extern/sol3/sol/stack_proxy.hpp | 2 +- extern/sol3/sol/stack_proxy_base.hpp | 2 +- extern/sol3/sol/stack_push.hpp | 107 +- extern/sol3/sol/stack_reference.hpp | 6 +- extern/sol3/sol/state.hpp | 2 +- extern/sol3/sol/state_handling.hpp | 18 +- extern/sol3/sol/state_view.hpp | 18 +- extern/sol3/sol/string_view.hpp | 2 +- extern/sol3/sol/table.hpp | 232 +-- extern/sol3/sol/table_core.hpp | 12 +- extern/sol3/sol/table_iterator.hpp | 2 +- extern/sol3/sol/table_proxy.hpp | 22 +- extern/sol3/sol/thread.hpp | 12 +- extern/sol3/sol/tie.hpp | 2 +- extern/sol3/sol/traits.hpp | 39 +- extern/sol3/sol/trampoline.hpp | 25 +- extern/sol3/sol/tuple.hpp | 186 +- extern/sol3/sol/types.hpp | 97 +- extern/sol3/sol/unicode.hpp | 616 +++--- extern/sol3/sol/unique_usertype_traits.hpp | 480 ++--- extern/sol3/sol/unreachable.hpp | 37 + extern/sol3/sol/unsafe_function.hpp | 10 +- extern/sol3/sol/unsafe_function_result.hpp | 8 +- extern/sol3/sol/userdata.hpp | 18 +- extern/sol3/sol/usertype.hpp | 2 +- extern/sol3/sol/usertype_container.hpp | 90 +- extern/sol3/sol/usertype_container_launch.hpp | 2 +- extern/sol3/sol/usertype_core.hpp | 4 +- extern/sol3/sol/usertype_proxy.hpp | 2 +- extern/sol3/sol/usertype_storage.hpp | 14 +- extern/sol3/sol/usertype_traits.hpp | 122 +- extern/sol3/sol/utility/is_integer.hpp | 43 + extern/sol3/sol/utility/to_string.hpp | 59 + extern/sol3/sol/variadic_args.hpp | 2 +- extern/sol3/sol/variadic_results.hpp | 4 +- extern/sol3/sol/version.hpp | 202 +- extern/sol3/sol/wrapper.hpp | 4 +- 118 files changed, 6291 insertions(+), 5557 deletions(-) create mode 100644 extern/sol3/sol/abort.hpp create mode 100644 extern/sol3/sol/config.hpp create mode 100644 extern/sol3/sol/forward_as.hpp create mode 100644 extern/sol3/sol/unreachable.hpp create mode 100644 extern/sol3/sol/utility/is_integer.hpp create mode 100644 extern/sol3/sol/utility/to_string.hpp diff --git a/extern/sol3/README.md b/extern/sol3/README.md index 202b2ca08b..fe249704c4 100644 --- a/extern/sol3/README.md +++ b/extern/sol3/README.md @@ -1,5 +1,8 @@ -The code in this directory is copied from https://github.com/ThePhD/sol2.git (64096348465b980e2f1d0e5ba9cbeea8782e8f27) +The code in this directory is copied from https://github.com/ThePhD/sol2.git (c1f95a773c6f8f4fde8ca3efe872e7286afe4444) and has been patched to include -Additional changes include cherry-picking upstream commit d805d027e0a0a7222e936926139f06e23828ce9f to fix compilation under Clang 19. +https://github.com/ThePhD/sol2/pull/1674 (71d85143ad69164f5f52c3bdab91fb503c676eb4) +https://github.com/ThePhD/sol2/pull/1676 (a6872ef46b08704b9069ebf83161f4637459ce63) +https://github.com/ThePhD/sol2/pull/1716 (5b6881ed94c795298eae72b6848308e9a37e42c5) +https://github.com/ThePhD/sol2/pull/1722 (ab874eb0e8ef8aea4c10074a89efa25f62a29d9a) License: MIT diff --git a/extern/sol3/sol/abort.hpp b/extern/sol3/sol/abort.hpp new file mode 100644 index 0000000000..692244daa7 --- /dev/null +++ b/extern/sol3/sol/abort.hpp @@ -0,0 +1,47 @@ +// sol2 + +// The MIT License (MIT) + +// Copyright (c) 2013-2022 Rapptz, ThePhD and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#ifndef SOL_ABORT_HPP +#define SOL_ABORT_HPP + +#include + +#include + +#include + +// clang-format off +#if SOL_IS_ON(SOL_DEBUG_BUILD) + #if SOL_IS_ON(SOL_COMPILER_VCXX) + #define SOL_DEBUG_ABORT() \ + if (true) { ::std::abort(); } \ + static_assert(true, "") + #else + #define SOL_DEBUG_ABORT() ::std::abort() + #endif +#else + #define SOL_DEBUG_ABORT() static_assert(true, "") +#endif +// clang-format on + +#endif // SOL_ABORT_HPP diff --git a/extern/sol3/sol/as_args.hpp b/extern/sol3/sol/as_args.hpp index 5afe78b0e4..719a3cdc99 100644 --- a/extern/sol3/sol/as_args.hpp +++ b/extern/sol3/sol/as_args.hpp @@ -2,7 +2,7 @@ // The MIT License (MIT) -// Copyright (c) 2013-2021 Rapptz, ThePhD and contributors +// Copyright (c) 2013-2022 Rapptz, ThePhD and contributors // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in diff --git a/extern/sol3/sol/as_returns.hpp b/extern/sol3/sol/as_returns.hpp index 0ac499e67d..982f408b71 100644 --- a/extern/sol3/sol/as_returns.hpp +++ b/extern/sol3/sol/as_returns.hpp @@ -2,7 +2,7 @@ // The MIT License (MIT) -// Copyright (c) 2013-2021 Rapptz, ThePhD and contributors +// Copyright (c) 2013-2022 Rapptz, ThePhD and contributors // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in diff --git a/extern/sol3/sol/assert.hpp b/extern/sol3/sol/assert.hpp index e46b9f122a..7f27905dc4 100644 --- a/extern/sol3/sol/assert.hpp +++ b/extern/sol3/sol/assert.hpp @@ -1,99 +1,99 @@ -// sol2 - -// The MIT License (MIT) - -// Copyright (c) 2013-2021 Rapptz, ThePhD and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#pragma once - -#ifndef SOL_ASSERT_HPP -#define SOL_ASSERT_HPP - -#include - -#if SOL_IS_ON(SOL2_CI_I_) - -struct pre_main { - pre_main() { -#ifdef _MSC_VER - _set_abort_behavior(0, _WRITE_ABORT_MSG); -#endif - } -} inline sol2_ci_dont_lock_ci_please = {}; - -#endif // Prevent lockup when doing Continuous Integration - - -// clang-format off - -#if SOL_IS_ON(SOL_USER_C_ASSERT_I_) - #define sol_c_assert(...) SOL_C_ASSERT(__VA_ARGS__) -#else - #if SOL_IS_ON(SOL_DEBUG_BUILD_I_) - #include - #include - #include - - #define sol_c_assert(...) \ - do { \ - if (!(__VA_ARGS__)) { \ - std::cerr << "Assertion `" #__VA_ARGS__ "` failed in " << __FILE__ << " line " << __LINE__ << std::endl; \ - std::terminate(); \ - } \ - } while (false) - #else - #define sol_c_assert(...) \ - do { \ - if (false) { \ - (void)(__VA_ARGS__); \ - } \ - } while (false) - #endif -#endif - -#if SOL_IS_ON(SOL_USER_M_ASSERT_I_) - #define sol_m_assert(message, ...) SOL_M_ASSERT(message, __VA_ARGS__) -#else - #if SOL_IS_ON(SOL_DEBUG_BUILD_I_) - #include - #include - #include - - #define sol_m_assert(message, ...) \ - do { \ - if (!(__VA_ARGS__)) { \ - std::cerr << "Assertion `" #__VA_ARGS__ "` failed in " << __FILE__ << " line " << __LINE__ << ": " << message << std::endl; \ - std::terminate(); \ - } \ - } while (false) - #else - #define sol_m_assert(message, ...) \ - do { \ - if (false) { \ - (void)(__VA_ARGS__); \ - (void)sizeof(message); \ - } \ - } while (false) - #endif -#endif - -// clang-format on - -#endif // SOL_ASSERT_HPP +// sol2 + +// The MIT License (MIT) + +// Copyright (c) 2013-2022 Rapptz, ThePhD and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#pragma once + +#ifndef SOL_ASSERT_HPP +#define SOL_ASSERT_HPP + +#include + +#if SOL_IS_ON(SOL2_CI) + +struct pre_main { + pre_main() { +#ifdef _MSC_VER + _set_abort_behavior(0, _WRITE_ABORT_MSG); +#endif + } +} inline sol2_ci_dont_lock_ci_please = {}; + +#endif // Prevent lockup when doing Continuous Integration + + +// clang-format off + +#if SOL_IS_ON(SOL_USER_ASSERT) + #define SOL_ASSERT(...) SOL_C_ASSERT(__VA_ARGS__) +#else + #if SOL_IS_ON(SOL_DEBUG_BUILD) + #include + #include + #include + + #define SOL_ASSERT(...) \ + do { \ + if (!(__VA_ARGS__)) { \ + std::cerr << "Assertion `" #__VA_ARGS__ "` failed in " << __FILE__ << " line " << __LINE__ << std::endl; \ + std::terminate(); \ + } \ + } while (false) + #else + #define SOL_ASSERT(...) \ + do { \ + if (false) { \ + (void)(__VA_ARGS__); \ + } \ + } while (false) + #endif +#endif + +#if SOL_IS_ON(SOL_USER_ASSERT_MSG) + #define SOL_ASSERT_MSG(message, ...) SOL_ASSERT_MSG(message, __VA_ARGS__) +#else + #if SOL_IS_ON(SOL_DEBUG_BUILD) + #include + #include + #include + + #define SOL_ASSERT_MSG(message, ...) \ + do { \ + if (!(__VA_ARGS__)) { \ + std::cerr << "Assertion `" #__VA_ARGS__ "` failed in " << __FILE__ << " line " << __LINE__ << ": " << message << std::endl; \ + std::terminate(); \ + } \ + } while (false) + #else + #define SOL_ASSERT_MSG(message, ...) \ + do { \ + if (false) { \ + (void)(__VA_ARGS__); \ + (void)sizeof(message); \ + } \ + } while (false) + #endif +#endif + +// clang-format on + +#endif // SOL_ASSERT_HPP diff --git a/extern/sol3/sol/base_traits.hpp b/extern/sol3/sol/base_traits.hpp index a28f23a74c..204afc276f 100644 --- a/extern/sol3/sol/base_traits.hpp +++ b/extern/sol3/sol/base_traits.hpp @@ -1,123 +1,156 @@ -// sol2 - -// The MIT License (MIT) - -// Copyright (c) 2013-2021 Rapptz, ThePhD and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#ifndef SOL_BASE_TRAITS_HPP -#define SOL_BASE_TRAITS_HPP - -#include - -namespace sol { - namespace detail { - struct unchecked_t { }; - const unchecked_t unchecked = unchecked_t {}; - } // namespace detail - - namespace meta { - using sfinae_yes_t = std::true_type; - using sfinae_no_t = std::false_type; - - template - using void_t = void; - - template - using unqualified = std::remove_cv>; - - template - using unqualified_t = typename unqualified::type; - - namespace meta_detail { - template - struct unqualified_non_alias : unqualified { }; - - template