From 6cffb266c7a8b48b6d645599f76e77fb3fb9bc6b Mon Sep 17 00:00:00 2001 From: Corentin Schreiber Date: Sat, 26 Mar 2022 09:34:05 +0000 Subject: [PATCH 01/53] Fixed occurences of is_cstr which should have been is_cstr_or_string --- include/sol/stack_field.hpp | 2 +- include/sol/traits.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sol/stack_field.hpp b/include/sol/stack_field.hpp index 70b0903a..a0ef28f8 100644 --- a/include/sol/stack_field.hpp +++ b/include/sol/stack_field.hpp @@ -212,7 +212,7 @@ namespace sol { namespace stack { } } else { - if constexpr (meta::is_c_str_v) { + if constexpr (meta::is_c_str_or_string_v) { if constexpr (global) { push(L, std::forward(value)); lua_setglobal(L, &key[0]); diff --git a/include/sol/traits.hpp b/include/sol/traits.hpp index 3e7ff4ce..5af4cb37 100644 --- a/include/sol/traits.hpp +++ b/include/sol/traits.hpp @@ -699,7 +699,7 @@ namespace sol { namespace meta { using is_c_str_or_string = is_c_str_or_string_of; template - constexpr inline bool is_c_str_or_string_v = is_c_str::value; + constexpr inline bool is_c_str_or_string_v = is_c_str_or_string::value; template struct is_move_only : all>, neg>>, std::is_move_constructible>> { }; From 64096348465b980e2f1d0e5ba9cbeea8782e8f27 Mon Sep 17 00:00:00 2001 From: Corentin Schreiber Date: Sat, 26 Mar 2022 09:34:42 +0000 Subject: [PATCH 02/53] Don't use is_c_str_or_string for char[] detection in usertype storage --- include/sol/usertype_storage.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index b8475134..fdfac5ff 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -66,11 +66,11 @@ namespace sol { namespace u_detail { template struct binding : binding_base { using uF = meta::unqualified_t; - using F = meta::conditional_t + using F = meta::conditional_t #if SOL_IS_ON(SOL_CHAR8_T_I_) - || meta::is_c_str_or_string_of_v + || meta::is_c_str_of_v #endif - || meta::is_c_str_or_string_of_v || meta::is_c_str_or_string_of_v || meta::is_c_str_or_string_of_v, + || meta::is_c_str_of_v || meta::is_c_str_of_v || meta::is_c_str_of_v, std::add_pointer_t>>, std::decay_t>; F data_; From 2198d9374d260f168d53b6248e49068a6307227d Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 12 Jun 2022 00:33:17 -0400 Subject: [PATCH 03/53] =?UTF-8?q?=E2=9C=A8=20Wasteful=20(but=20needed)=20.?= =?UTF-8?q?is()=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/sol/table_proxy.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/sol/table_proxy.hpp b/include/sol/table_proxy.hpp index 680d2329..504b244c 100644 --- a/include/sol/table_proxy.hpp +++ b/include/sol/table_proxy.hpp @@ -133,6 +133,13 @@ namespace sol { return std::move(*this).set(std::move(other)); } + template + bool is() const { + typedef decltype(get()) U; + optional option = this->get>(); + return option.has_value(); + } + template decltype(auto) get() const& { using idx_seq = std::make_index_sequence>>; From 385645222afa11b06d6c5cc87aca4c0cdfc66efa Mon Sep 17 00:00:00 2001 From: Immortale Date: Fri, 29 Apr 2022 17:53:31 +0300 Subject: [PATCH 04/53] Fixed exception condition --- include/sol/stack_guard.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sol/stack_guard.hpp b/include/sol/stack_guard.hpp index 9ae9a073..a4e05874 100644 --- a/include/sol/stack_guard.hpp +++ b/include/sol/stack_guard.hpp @@ -31,7 +31,7 @@ namespace sol { namespace detail { inline void stack_fail(int, int) { -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS_I_) throw error(detail::direct_error, "imbalanced stack after operation finish"); #else // Lol, what do you want, an error printout? :3c From 4efea0ff3c56d86ec039cc059245783230839010 Mon Sep 17 00:00:00 2001 From: Shepherd Date: Wed, 22 Jun 2022 16:32:13 -0400 Subject: [PATCH 05/53] =?UTF-8?q?=E2=9C=A8=20Test=20and=20fix=20#1315?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — 🛠 Update SOL_IS_(DEFAULT_)ON/OFF usage to be more idiomatic and less confusing (add SOL_RAW_* alternatives as well) — 💚 Re-check CI — 👷‍♀️ Add missing header from ebco.hpp --- include/sol/assert.hpp | 10 +- include/sol/bind_traits.hpp | 6 +- include/sol/bytecode.hpp | 2 +- include/sol/call.hpp | 14 +- include/sol/compatibility.hpp | 4 +- include/sol/compatibility/lua_version.hpp | 22 +-- include/sol/coroutine.hpp | 10 +- include/sol/demangle.hpp | 6 +- include/sol/detail/build_version.hpp | 62 ++++---- include/sol/dump_handler.hpp | 2 +- include/sol/ebco.hpp | 1 + include/sol/environment.hpp | 12 +- include/sol/epilogue.hpp | 2 +- include/sol/error_handler.hpp | 2 +- include/sol/forward.hpp | 8 +- include/sol/forward_detail.hpp | 2 +- include/sol/function_types.hpp | 12 +- include/sol/function_types_stateful.hpp | 4 +- include/sol/function_types_stateless.hpp | 26 ++-- include/sol/function_types_templated.hpp | 2 +- include/sol/load_result.hpp | 4 +- include/sol/lua_table.hpp | 8 +- include/sol/lua_value.hpp | 2 +- include/sol/metatable.hpp | 8 +- include/sol/optional.hpp | 10 +- include/sol/optional_implementation.hpp | 12 +- include/sol/packaged_coroutine.hpp | 10 +- include/sol/prologue.hpp | 4 +- include/sol/protected_function.hpp | 18 +-- include/sol/protected_function_result.hpp | 6 +- include/sol/protected_handler.hpp | 2 +- include/sol/reference.hpp | 12 +- include/sol/sol.hpp | 16 +- include/sol/stack.hpp | 10 +- include/sol/stack_check_get_unqualified.hpp | 6 +- include/sol/stack_check_unqualified.hpp | 28 ++-- include/sol/stack_core.hpp | 24 +-- include/sol/stack_get_unqualified.hpp | 30 ++-- include/sol/stack_push.hpp | 92 ++++++------ include/sol/stack_reference.hpp | 4 +- include/sol/state_handling.hpp | 16 +- include/sol/state_view.hpp | 16 +- include/sol/table_core.hpp | 8 +- include/sol/thread.hpp | 10 +- include/sol/traits.hpp | 10 +- include/sol/trampoline.hpp | 18 +-- include/sol/types.hpp | 22 +-- include/sol/unsafe_function.hpp | 8 +- include/sol/userdata.hpp | 16 +- include/sol/usertype_container.hpp | 4 +- include/sol/usertype_core.hpp | 2 +- include/sol/usertype_storage.hpp | 4 +- include/sol/version.hpp | 85 ++++++----- include/sol/wrapper.hpp | 2 +- tests/CMakeLists.txt | 2 +- .../function_pointers/source/main.cpp | 2 +- .../function_pointers/source/retrieval.cpp | 2 +- .../integer_value_fits/source/main.cpp | 2 +- .../source/negative_size_t.cpp | 17 ++- tests/enum/source/main.cpp | 2 +- tests/enum/source/read_only_iteration.cpp | 2 +- tests/environment/source/get.cpp | 2 +- tests/environment/source/main.cpp | 2 +- tests/environment/source/sandboxing.cpp | 2 +- tests/environment/source/shadowing.cpp | 2 +- tests/environment/source/this_environment.cpp | 2 +- tests/exceptions/source/functions.cpp | 2 +- .../exceptions/source/functions.noexcept.cpp | 4 +- .../exceptions/source/functions.yielding.cpp | 2 +- tests/exceptions/source/main.cpp | 2 +- tests/exceptions/source/usertypes.cpp | 2 +- .../exceptions/source/usertypes.yielding.cpp | 2 +- tests/numerics/source/large.cpp | 2 +- tests/numerics/source/main.cpp | 2 +- .../simple/source/1000 - readonly warning.cpp | 29 +++- ...as_function binding triggers correctly.cpp | 31 +++- .../source/1067 - optional bindings.cpp | 29 +++- .../1072 - capture exception propagation.cpp | 44 ++++-- ...087 - readonly property error checking.cpp | 45 ++++-- ...1095 - raw_get from global table fails.cpp | 38 ++++- .../source/1096 - functions binding wrong.cpp | 29 +++- ... destructed from non-destructed memory.cpp | 37 ++++- ...method gets const-morphed in internals.cpp | 33 +++- ...1192 - incorrect alignment calculation.cpp | 37 +++-- ...11 - protected_function_result nullptr.cpp | 35 ++++- .../source/1315 - keep-alive memory.cpp | 141 ++++++++++++++++++ tests/regression_tests/simple/source/main.cpp | 71 ++++----- tests/run_time/source/basic.cpp | 2 +- .../source/container.usertype_check.cpp | 2 +- tests/run_time/source/container_semantics.cpp | 6 +- .../source/container_semantics.custom.cpp | 2 +- .../source/container_semantics.ordered.cpp | 2 +- .../source/container_semantics.unordered.cpp | 2 +- tests/run_time/source/container_shims.cpp | 2 +- tests/run_time/source/container_table.cpp | 2 +- tests/run_time/source/containers.cpp | 6 +- .../run_time/source/containers.roundtrip.cpp | 2 +- tests/run_time/source/containers.table.cpp | 2 +- tests/run_time/source/coroutines.cpp | 2 +- tests/run_time/source/customizations.cpp | 2 +- .../source/customizations_private.cpp | 2 +- tests/run_time/source/dump.cpp | 2 +- tests/run_time/source/functions.cpp | 6 +- tests/run_time/source/functions.std.cpp | 2 +- tests/run_time/source/gc.cpp | 2 +- tests/run_time/source/lua_value.cpp | 6 +- tests/run_time/source/main.cpp | 2 +- tests/run_time/source/operators.cpp | 2 +- tests/run_time/source/overflow.cpp | 2 +- tests/run_time/source/plain_types.cpp | 2 +- tests/run_time/source/policies.cpp | 2 +- tests/run_time/source/proxies.cpp | 2 +- tests/run_time/source/state.cpp | 2 +- tests/run_time/source/storage.cpp | 2 +- tests/run_time/source/strings.cpp | 2 +- tests/run_time/source/tables.checks.cpp | 2 +- tests/run_time/source/tables.clear.cpp | 2 +- tests/run_time/source/tables.cpp | 2 +- tests/run_time/source/tables.enums.cpp | 2 +- tests/run_time/source/tables.indexing.cpp | 2 +- tests/run_time/source/tables.insertion.cpp | 2 +- tests/run_time/source/tables.traversal.cpp | 2 +- .../source/usertypes.auxiliary_keys.cpp | 2 +- tests/run_time/source/usertypes.basic.cpp | 2 +- .../source/usertypes.constructors.cpp | 2 +- tests/run_time/source/usertypes.cpp | 2 +- .../run_time/source/usertypes.inheritance.cpp | 2 +- .../source/usertypes.inheritance.multi.cpp | 2 +- .../source/usertypes.member_variables.cpp | 2 +- tests/run_time/source/usertypes.overload.cpp | 2 +- .../run_time/source/usertypes.properties.cpp | 2 +- tests/run_time/source/usertypes.runtime.cpp | 2 +- tests/run_time/source/usertypes.unique.cpp | 2 +- .../run_time/source/usertypes.unregister.cpp | 2 +- tests/run_time/source/utility.cpp | 2 +- tests/run_time/source/variadics.cpp | 2 +- 136 files changed, 952 insertions(+), 554 deletions(-) create mode 100644 tests/regression_tests/simple/source/1315 - keep-alive memory.cpp diff --git a/include/sol/assert.hpp b/include/sol/assert.hpp index 860ac3de..7d4b732d 100644 --- a/include/sol/assert.hpp +++ b/include/sol/assert.hpp @@ -28,7 +28,7 @@ #include -#if SOL_IS_ON(SOL2_CI_I_) +#if SOL_IS_ON(SOL2_CI) struct pre_main { pre_main() { @@ -43,10 +43,10 @@ struct pre_main { // clang-format off -#if SOL_IS_ON(SOL_USER_C_ASSERT_I_) +#if SOL_IS_ON(SOL_USER_C_ASSERT) #define sol_c_assert(...) SOL_C_ASSERT(__VA_ARGS__) #else - #if SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #if SOL_IS_ON(SOL_DEBUG_BUILD) #include #include #include @@ -68,10 +68,10 @@ struct pre_main { #endif #endif -#if SOL_IS_ON(SOL_USER_M_ASSERT_I_) +#if SOL_IS_ON(SOL_USER_M_ASSERT) #define sol_m_assert(message, ...) SOL_M_ASSERT(message, __VA_ARGS__) #else - #if SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #if SOL_IS_ON(SOL_DEBUG_BUILD) #include #include #include diff --git a/include/sol/bind_traits.hpp b/include/sol/bind_traits.hpp index e11d753d..c0b5b268 100644 --- a/include/sol/bind_traits.hpp +++ b/include/sol/bind_traits.hpp @@ -196,7 +196,7 @@ namespace sol { namespace meta { typedef R (T::*function_pointer_type)(Args..., ...) const volatile&&; }; -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) template struct fx_traits : public basic_traits { @@ -311,7 +311,7 @@ namespace sol { namespace meta { #endif // noexcept is part of a function's type -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) && SOL_IS_ON(SOL_PLATFORM_X86_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) && SOL_IS_ON(SOL_PLATFORM_X86) template struct fx_traits : public basic_traits { typedef R(__stdcall* function_pointer_type)(Args...); @@ -369,7 +369,7 @@ namespace sol { namespace meta { typedef R (__stdcall T::*function_pointer_type)(Args...) const volatile&&; }; -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) template struct fx_traits : public basic_traits { diff --git a/include/sol/bytecode.hpp b/include/sol/bytecode.hpp index a930d9a3..71a375ce 100644 --- a/include/sol/bytecode.hpp +++ b/include/sol/bytecode.hpp @@ -99,7 +99,7 @@ namespace sol { using storage_t = Container; const std::byte* p_code = static_cast(memory); storage_t& bc = *static_cast(userdata_pointer); -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) bc.insert(bc.cend(), p_code, p_code + memory_size); #else try { diff --git a/include/sol/call.hpp b/include/sol/call.hpp index d06cf96f..7b932442 100644 --- a/include/sol/call.hpp +++ b/include/sol/call.hpp @@ -54,7 +54,7 @@ namespace sol { lua_createtable(L, static_cast(sizeof...(In)), 0); stack_reference deps(L, -1); auto per_dep = [&L, &deps](int i) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushvalue(L, i); @@ -79,7 +79,7 @@ namespace sol { } lua_createtable(L, static_cast(sdeps.size()), 0); stack_reference deps(L, -1); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, static_cast(sdeps.size()), detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow for (std::size_t i = 0; i < sdeps.size(); ++i) { @@ -429,7 +429,7 @@ namespace sol { } }; -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) template struct agnostic_lua_call_wrapper { static int call(lua_State* L, detail::lua_CFunction_noexcept f) { @@ -482,7 +482,7 @@ namespace sol { "It seems like you might have accidentally bound a class type with a member function method that does not correspond to the " "class. For example, there could be a small type in your new_usertype(...) binding, where you specify one class \"T\" " "but then bind member methods from a complete unrelated class. Check things over!"); -#if SOL_IS_ON(SOL_SAFE_USERTYPE_I_) +#if SOL_IS_ON(SOL_SAFE_USERTYPE) auto maybeo = stack::check_get(L, 1); if (!maybeo || maybeo.value() == nullptr) { return luaL_error(L, @@ -515,7 +515,7 @@ namespace sol { "It seems like you might have accidentally bound a class type with a member function method that does not correspond " "to the class. For example, there could be a small type in your new_usertype(...) binding, where you specify one " "class \"T\" but then bind member methods from a complete unrelated class. Check things over!"); -#if SOL_IS_ON(SOL_SAFE_USERTYPE_I_) +#if SOL_IS_ON(SOL_SAFE_USERTYPE) auto maybeo = stack::check_get(L, 1); if (!maybeo || maybeo.value() == nullptr) { if (is_variable) { @@ -573,7 +573,7 @@ namespace sol { } else { using Ta = meta::conditional_t, object_type, T>; -#if SOL_IS_ON(SOL_SAFE_USERTYPE_I_) +#if SOL_IS_ON(SOL_SAFE_USERTYPE) auto maybeo = stack::check_get(L, 1); if (!maybeo || maybeo.value() == nullptr) { if (is_variable) { @@ -811,7 +811,7 @@ namespace sol { using args_list = meta::pop_front_type_t; using Ta = T; using Oa = std::remove_pointer_t; -#if SOL_IS_ON(SOL_SAFE_USERTYPE_I_) +#if SOL_IS_ON(SOL_SAFE_USERTYPE) auto maybeo = stack::check_get(L, 1); if (!maybeo || maybeo.value() == nullptr) { if (is_variable) { diff --git a/include/sol/compatibility.hpp b/include/sol/compatibility.hpp index d2d01bd7..6ed9be80 100644 --- a/include/sol/compatibility.hpp +++ b/include/sol/compatibility.hpp @@ -32,9 +32,9 @@ #include #include -#if SOL_IS_ON(SOL_USE_COMPATIBILITY_LAYER_I_) +#if SOL_IS_ON(SOL_USE_COMPATIBILITY_LAYER) -#if SOL_IS_ON(SOL_USE_CXX_LUA_I_) || SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_) +#if SOL_IS_ON(SOL_USE_CXX_LUA) || SOL_IS_ON(SOL_USE_CXX_LUAJIT) #ifndef COMPAT53_LUA_CPP #define COMPAT53_LUA_CPP 1 #endif // Build Lua Compat layer as C++ diff --git a/include/sol/compatibility/lua_version.hpp b/include/sol/compatibility/lua_version.hpp index 21011600..201fa6cc 100644 --- a/include/sol/compatibility/lua_version.hpp +++ b/include/sol/compatibility/lua_version.hpp @@ -28,11 +28,11 @@ // clang-format off -#if SOL_IS_ON(SOL_USE_CXX_LUA_I_) +#if SOL_IS_ON(SOL_USE_CXX_LUA) #include #include #include -#elif SOL_IS_ON(SOL_USE_LUA_HPP_I_) +#elif SOL_IS_ON(SOL_USE_LUA_HPP) #include #else extern "C" { @@ -54,9 +54,9 @@ #define SOL_USE_LUAJIT_I_ SOL_DEFAULT_OFF #endif // luajit -#if SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_) +#if SOL_IS_ON(SOL_USE_CXX_LUAJIT) #include -#elif SOL_IS_ON(SOL_USE_LUAJIT_I_) +#elif SOL_IS_ON(SOL_USE_LUAJIT) extern "C" { #include } @@ -64,7 +64,7 @@ #if defined(SOL_LUAJIT_VERSION) #define SOL_LUAJIT_VERSION_I_ SOL_LUAJIT_VERSION -#elif SOL_IS_ON(SOL_USE_LUAJIT_I_) +#elif SOL_IS_ON(SOL_USE_LUAJIT) #define SOL_LUAJIT_VERSION_I_ LUAJIT_VERSION_NUM #else #define SOL_LUAJIT_VERSION_I_ 0 @@ -123,7 +123,7 @@ #define SOL_PROPAGATE_EXCEPTIONS_I_ SOL_DEFAULT_ON #elif SOL_LUAJIT_VERSION_I_ >= 20000 // LuaJIT 2.0.x have exception support only on x64 builds - #if SOL_IS_ON(SOL_PLATFORM_X64_I_) + #if SOL_IS_ON(SOL_PLATFORM_X64) #define SOL_PROPAGATE_EXCEPTIONS_I_ SOL_DEFAULT_ON #else #define SOL_PROPAGATE_EXCEPTIONS_I_ SOL_OFF @@ -144,11 +144,11 @@ #define SOL_EXCEPTIONS_CATCH_ALL_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_USE_LUAJIT_I_) + #if SOL_IS_ON(SOL_USE_LUAJIT) #define SOL_EXCEPTIONS_CATCH_ALL_I_ SOL_DEFAULT_OFF - #elif SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_) + #elif SOL_IS_ON(SOL_USE_CXX_LUAJIT) #define SOL_EXCEPTIONS_CATCH_ALL_I_ SOL_DEFAULT_OFF - #elif SOL_IS_ON(SOL_USE_CXX_LUA_I_) + #elif SOL_IS_ON(SOL_USE_CXX_LUA) #define SOL_EXCEPTIONS_CATCH_ALL_I_ SOL_DEFAULT_OFF #else #define SOL_EXCEPTIONS_CATCH_ALL_I_ SOL_DEFAULT_ON @@ -162,7 +162,7 @@ #define SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE_I_ SOL_OFF #endif #else - #if SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS_I_) && SOL_IS_ON(SOL_USE_LUAJIT_I_) + #if SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS) && SOL_IS_ON(SOL_USE_LUAJIT) #define SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE_I_ SOL_ON #else #define SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE_I_ SOL_DEFAULT_OFF @@ -176,7 +176,7 @@ #define SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_ SOL_OFF #endif #else - #if SOL_IS_OFF(SOL_USE_LUAJIT_I_) && (SOL_LUA_VERSION > 501) + #if SOL_IS_OFF(SOL_USE_LUAJIT) && (SOL_LUA_VERSION > 501) #define SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_ SOL_ON #else #define SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_ SOL_DEFAULT_OFF diff --git a/include/sol/coroutine.hpp b/include/sol/coroutine.hpp index e4b9d814..7482060e 100644 --- a/include/sol/coroutine.hpp +++ b/include/sol/coroutine.hpp @@ -94,7 +94,7 @@ namespace sol { meta::neg>>, is_lua_reference>> = meta::enabler> basic_coroutine(T&& r) noexcept : base_t(std::forward(r)), m_error_handler(detail::get_default_handler::value>(r.lua_state())) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_function>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; @@ -157,7 +157,7 @@ namespace sol { } template >> = meta::enabler> basic_coroutine(lua_State* L, T&& r, handler_t eh) : base_t(L, std::forward(r)), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -180,7 +180,7 @@ namespace sol { : basic_coroutine(L, index, detail::get_default_handler::value>(L)) { } basic_coroutine(lua_State* L, absolute_index index, handler_t eh) : base_t(L, index), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety @@ -189,7 +189,7 @@ namespace sol { : basic_coroutine(L, index, detail::get_default_handler::value>(L)) { } basic_coroutine(lua_State* L, raw_index index, handler_t eh) : base_t(L, index), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety @@ -198,7 +198,7 @@ namespace sol { : basic_coroutine(L, index, detail::get_default_handler::value>(L)) { } basic_coroutine(lua_State* L, ref_index index, handler_t eh) : base_t(L, index), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); diff --git a/include/sol/demangle.hpp b/include/sol/demangle.hpp index 8c7c5ea2..4713855f 100644 --- a/include/sol/demangle.hpp +++ b/include/sol/demangle.hpp @@ -28,7 +28,7 @@ #include #include #include -#if SOL_IS_ON(SOL_MINGW_CCTYPE_IS_POISONED_I_) +#if SOL_IS_ON(SOL_MINGW_CCTYPE_IS_POISONED) extern "C" { #include } @@ -47,7 +47,7 @@ namespace sol { namespace detail { "`anonymous namespace'" } }; -#if SOL_IS_ON(SOL_COMPILER_GCC_I_) || SOL_IS_ON(SOL_COMPILER_CLANG_I_) +#if SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) inline std::string ctti_get_type_name_from_sig(std::string name) { // cardinal sins from MINGW using namespace std; @@ -85,7 +85,7 @@ namespace sol { namespace detail { inline std::string ctti_get_type_name() { return ctti_get_type_name_from_sig(__PRETTY_FUNCTION__); } -#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#elif SOL_IS_ON(SOL_COMPILER_VCXX) inline std::string ctti_get_type_name_from_sig(std::string name) { std::size_t start = name.find("get_type_name"); if (start == std::string::npos) diff --git a/include/sol/detail/build_version.hpp b/include/sol/detail/build_version.hpp index 8c26750f..e5de601f 100644 --- a/include/sol/detail/build_version.hpp +++ b/include/sol/detail/build_version.hpp @@ -36,7 +36,7 @@ #else #define SOL_DLL_I_ SOL_OFF #endif -#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) && (defined(DLL_) || defined(_DLL)) +#elif SOL_IS_ON(SOL_COMPILER_VCXX) && (defined(DLL_) || defined(_DLL)) #define SOL_DLL_I_ SOL_DEFAULT_ON #else #define SOL_DLL_I_ SOL_DEFAULT_OFF @@ -58,7 +58,7 @@ #else #define SOL_BUILD_I_ SOL_OFF #endif -#elif SOL_IS_ON(SOL_HEADER_ONLY_I_) +#elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_BUILD_I_ SOL_DEFAULT_OFF #else #define SOL_BUILD_I_ SOL_DEFAULT_ON @@ -77,7 +77,7 @@ #if defined(SOL_C_FUNCTION_LINKAGE) #define SOL_C_FUNCTION_LINKAGE_I_ SOL_C_FUNCTION_LINKAGE #else - #if SOL_IS_ON(SOL_BUILD_CXX_MODE_I_) + #if SOL_IS_ON(SOL_BUILD_CXX_MODE) // C++ #define SOL_C_FUNCTION_LINKAGE_I_ extern "C" #else @@ -89,12 +89,12 @@ #if defined(SOL_API_LINKAGE) #define SOL_API_LINKAGE_I_ SOL_API_LINKAGE #else - #if SOL_IS_ON(SOL_DLL_I_) - #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) || SOL_IS_ON(SOL_PLATFORM_WINDOWS_I_) || SOL_IS_ON(SOL_PLATFORM_CYGWIN_I_) + #if SOL_IS_ON(SOL_DLL) + #if SOL_IS_ON(SOL_COMPILER_VCXX) || SOL_IS_ON(SOL_PLATFORM_WINDOWS) || SOL_IS_ON(SOL_PLATFORM_CYGWIN) // MSVC Compiler; or, Windows, or Cygwin platforms - #if SOL_IS_ON(SOL_BUILD_I_) + #if SOL_IS_ON(SOL_BUILD) // Building the library - #if SOL_IS_ON(SOL_COMPILER_GCC_I_) + #if SOL_IS_ON(SOL_COMPILER_GCC) // Using GCC #define SOL_API_LINKAGE_I_ __attribute__((dllexport)) #else @@ -102,7 +102,7 @@ #define SOL_API_LINKAGE_I_ __declspec(dllexport) #endif #else - #if SOL_IS_ON(SOL_COMPILER_GCC_I_) + #if SOL_IS_ON(SOL_COMPILER_GCC) #define SOL_API_LINKAGE_I_ __attribute__((dllimport)) #else #define SOL_API_LINKAGE_I_ __declspec(dllimport) @@ -112,9 +112,9 @@ // extern if building normally on non-MSVC #define SOL_API_LINKAGE_I_ extern #endif - #elif SOL_IS_ON(SOL_UNITY_BUILD_I_) + #elif SOL_IS_ON(SOL_UNITY_BUILD) // Built-in library, like how stb typical works - #if SOL_IS_ON(SOL_HEADER_ONLY_I_) + #if SOL_IS_ON(SOL_HEADER_ONLY) // Header only, so functions are defined "inline" #define SOL_API_LINKAGE_I_ inline #else @@ -123,7 +123,7 @@ #endif #else // Normal static library - #if SOL_IS_ON(SOL_BUILD_CXX_MODE_I_) + #if SOL_IS_ON(SOL_BUILD_CXX_MODE) #define SOL_API_LINKAGE_I_ #else #define SOL_API_LINKAGE_I_ extern @@ -157,16 +157,16 @@ #if defined(SOL_FUNC_DECL) #define SOL_FUNC_DECL_I_ SOL_FUNC_DECL -#elif SOL_IS_ON(SOL_HEADER_ONLY_I_) +#elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_FUNC_DECL_I_ -#elif SOL_IS_ON(SOL_DLL_I_) - #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) - #if SOL_IS_ON(SOL_BUILD_I_) +#elif SOL_IS_ON(SOL_DLL) + #if SOL_IS_ON(SOL_COMPILER_VCXX) + #if SOL_IS_ON(SOL_BUILD) #define SOL_FUNC_DECL_I_ extern __declspec(dllexport) #else #define SOL_FUNC_DECL_I_ extern __declspec(dllimport) #endif - #elif SOL_IS_ON(SOL_COMPILER_GCC_I_) || SOL_IS_ON(SOL_COMPILER_CLANG_I_) + #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_FUNC_DECL_I_ extern __attribute__((visibility("default"))) #else #define SOL_FUNC_DECL_I_ extern @@ -175,16 +175,16 @@ #if defined(SOL_FUNC_DEFN) #define SOL_FUNC_DEFN_I_ SOL_FUNC_DEFN -#elif SOL_IS_ON(SOL_HEADER_ONLY_I_) +#elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_FUNC_DEFN_I_ inline -#elif SOL_IS_ON(SOL_DLL_I_) - #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) - #if SOL_IS_ON(SOL_BUILD_I_) +#elif SOL_IS_ON(SOL_DLL) + #if SOL_IS_ON(SOL_COMPILER_VCXX) + #if SOL_IS_ON(SOL_BUILD) #define SOL_FUNC_DEFN_I_ __declspec(dllexport) #else #define SOL_FUNC_DEFN_I_ __declspec(dllimport) #endif - #elif SOL_IS_ON(SOL_COMPILER_GCC_I_) || SOL_IS_ON(SOL_COMPILER_CLANG_I_) + #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_FUNC_DEFN_I_ __attribute__((visibility("default"))) #else #define SOL_FUNC_DEFN_I_ @@ -193,16 +193,16 @@ #if defined(SOL_HIDDEN_FUNC_DECL) #define SOL_HIDDEN_FUNC_DECL_I_ SOL_HIDDEN_FUNC_DECL -#elif SOL_IS_ON(SOL_HEADER_ONLY_I_) +#elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_HIDDEN_FUNC_DECL_I_ -#elif SOL_IS_ON(SOL_DLL_I_) - #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) - #if SOL_IS_ON(SOL_BUILD_I_) +#elif SOL_IS_ON(SOL_DLL) + #if SOL_IS_ON(SOL_COMPILER_VCXX) + #if SOL_IS_ON(SOL_BUILD) #define SOL_HIDDEN_FUNC_DECL_I_ extern __declspec(dllexport) #else #define SOL_HIDDEN_FUNC_DECL_I_ extern __declspec(dllimport) #endif - #elif SOL_IS_ON(SOL_COMPILER_GCC_I_) || SOL_IS_ON(SOL_COMPILER_CLANG_I_) + #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_HIDDEN_FUNC_DECL_I_ extern __attribute__((visibility("default"))) #else #define SOL_HIDDEN_FUNC_DECL_I_ extern @@ -211,16 +211,16 @@ #if defined(SOL_HIDDEN_FUNC_DEFN) #define SOL_HIDDEN_FUNC_DEFN_I_ SOL_HIDDEN_FUNC_DEFN -#elif SOL_IS_ON(SOL_HEADER_ONLY_I_) +#elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_HIDDEN_FUNC_DEFN_I_ inline -#elif SOL_IS_ON(SOL_DLL_I_) - #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) - #if SOL_IS_ON(SOL_BUILD_I_) +#elif SOL_IS_ON(SOL_DLL) + #if SOL_IS_ON(SOL_COMPILER_VCXX) + #if SOL_IS_ON(SOL_BUILD) #define SOL_HIDDEN_FUNC_DEFN_I_ #else #define SOL_HIDDEN_FUNC_DEFN_I_ #endif - #elif SOL_IS_ON(SOL_COMPILER_GCC_I_) || SOL_IS_ON(SOL_COMPILER_CLANG_I_) + #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_HIDDEN_FUNC_DEFN_I_ __attribute__((visibility("hidden"))) #else #define SOL_HIDDEN_FUNC_DEFN_I_ diff --git a/include/sol/dump_handler.hpp b/include/sol/dump_handler.hpp index 02613653..966255e5 100644 --- a/include/sol/dump_handler.hpp +++ b/include/sol/dump_handler.hpp @@ -61,7 +61,7 @@ namespace sol { } inline int dump_throw_on_error(lua_State* L_, int result_code, lua_Writer writer_function, void* userdata_pointer_, bool strip) { -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) return dump_panic_on_error(L_, result_code, writer_function, userdata_pointer_, strip); #else (void)L_; diff --git a/include/sol/ebco.hpp b/include/sol/ebco.hpp index af54024b..6fbeaf3f 100644 --- a/include/sol/ebco.hpp +++ b/include/sol/ebco.hpp @@ -26,6 +26,7 @@ #include #include +#include namespace sol { namespace detail { diff --git a/include/sol/environment.hpp b/include/sol/environment.hpp index 2529403b..8d1e0a38 100644 --- a/include/sol/environment.hpp +++ b/include/sol/environment.hpp @@ -58,7 +58,7 @@ namespace sol { basic_environment(env_key_t, const stack_reference& extraction_target) : base_t(detail::no_safety, extraction_target.lua_state(), (stack::push_environment_of(extraction_target), -1)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(this->lua_state(), -1, handler); #endif // Safety @@ -67,20 +67,20 @@ namespace sol { template basic_environment(env_key_t, const basic_reference& extraction_target) : base_t(detail::no_safety, extraction_target.lua_state(), (stack::push_environment_of(extraction_target), -1)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(this->lua_state(), -1, handler); #endif // Safety lua_pop(this->lua_state(), 2); } basic_environment(lua_State* L, int index = -1) : base_t(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_environment(lua_State* L, ref_index index) : base_t(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(L, -1, handler); @@ -90,7 +90,7 @@ namespace sol { meta::enable, basic_environment>>, meta::neg>, meta::neg>>, is_lua_reference>> = meta::enabler> basic_environment(T&& r) noexcept : base_t(detail::no_safety, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_environment>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; @@ -103,7 +103,7 @@ namespace sol { template >> = meta::enabler> basic_environment(lua_State* L, T&& r) noexcept : base_t(detail::no_safety, L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_environment>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; diff --git a/include/sol/epilogue.hpp b/include/sol/epilogue.hpp index 199b9812..d6b32a3a 100644 --- a/include/sol/epilogue.hpp +++ b/include/sol/epilogue.hpp @@ -31,7 +31,7 @@ #undef SOL_PROLOGUE_I_ #endif -#if SOL_IS_ON(SOL_BUILD_CXX_MODE_I_) +#if SOL_IS_ON(SOL_BUILD_CXX_MODE) #undef _FWD #undef _MOVE #endif diff --git a/include/sol/error_handler.hpp b/include/sol/error_handler.hpp index cfda69bd..1e242386 100644 --- a/include/sol/error_handler.hpp +++ b/include/sol/error_handler.hpp @@ -62,7 +62,7 @@ namespace sol { case type::poly: return "anything"; case type::userdata: { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 2, "not enough space to push get the type name"); #endif // make sure stack doesn't overflow if (lua_getmetatable(L, index) == 0) { diff --git a/include/sol/forward.hpp b/include/sol/forward.hpp index 708e711e..16cc2e10 100644 --- a/include/sol/forward.hpp +++ b/include/sol/forward.hpp @@ -30,7 +30,7 @@ #include #include -#if SOL_IS_ON(SOL_USE_CXX_LUA_I_) || SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_) +#if SOL_IS_ON(SOL_USE_CXX_LUA) || SOL_IS_ON(SOL_USE_CXX_LUAJIT) struct lua_State; #else extern "C" { @@ -117,7 +117,7 @@ namespace sol { using main_protected_function = main_safe_function; using stack_protected_function = stack_safe_function; using stack_aligned_protected_function = stack_aligned_safe_function; -#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS) using function = protected_function; using main_function = main_protected_function; using stack_function = stack_protected_function; @@ -133,7 +133,7 @@ namespace sol { struct unsafe_function_result; struct protected_function_result; using safe_function_result = protected_function_result; -#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS) using function_result = safe_function_result; #else using function_result = unsafe_function_result; @@ -234,7 +234,7 @@ namespace sol { struct record; } -#if SOL_IS_OFF(SOL_USE_BOOST_I_) +#if SOL_IS_OFF(SOL_USE_BOOST) template class optional; diff --git a/include/sol/forward_detail.hpp b/include/sol/forward_detail.hpp index 5815f485..72c3f76c 100644 --- a/include/sol/forward_detail.hpp +++ b/include/sol/forward_detail.hpp @@ -32,7 +32,7 @@ namespace sol { namespace detail { const bool default_safe_function_calls = -#if SOL_IS_ON(SOL_SAFE_FUNCTION_CALLS_I_) +#if SOL_IS_ON(SOL_SAFE_FUNCTION_CALLS) true; #else false; diff --git a/include/sol/function_types.hpp b/include/sol/function_types.hpp index 18905890..87707d7e 100644 --- a/include/sol/function_types.hpp +++ b/include/sol/function_types.hpp @@ -217,7 +217,7 @@ namespace sol { int upvalues = 0; upvalues += stack::push(L, nullptr); upvalues += stack::push(L, std::forward(fx)); -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) if constexpr (std::is_nothrow_invocable_r_v) { detail::lua_CFunction_noexcept cf = &lua_c_noexcept_wrapper; lua_pushcclosure(L, reinterpret_cast(cf), upvalues); @@ -237,7 +237,7 @@ namespace sol { int upvalues = 0; upvalues += stack::push(L, nullptr); upvalues += stack::push(L, std::forward(fx)); -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) if constexpr (std::is_nothrow_invocable_r_v) { detail::lua_CFunction_noexcept cf = &lua_c_noexcept_wrapper; lua_pushcclosure(L, reinterpret_cast(cf), upvalues); @@ -398,7 +398,7 @@ namespace sol { struct unqualified_pusher>, meta::neg>, meta::neg>> -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) , meta::neg>, meta::neg>> @@ -711,7 +711,7 @@ namespace sol { namespace stack_detail { template bool check_function_pointer(lua_State* L, int index, Handler&& handler, record& tracking) noexcept { -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) tracking.use(1); bool success = lua_iscfunction(L, index) == 1; if (success) { @@ -737,7 +737,7 @@ namespace sol { template Function* get_function_pointer(lua_State* L, int index, record& tracking) noexcept { -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) tracking.use(1); auto udata = stack::stack_detail::get_as_upvalues_using_function(L, index); Function* fx = udata.first; @@ -747,7 +747,7 @@ namespace sol { (void)index; (void)tracking; static_assert(meta::meta_detail::always_true::value, -#if SOL_IS_DEFAULT_OFF(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_DEFAULT_OFF(SOL_GET_FUNCTION_POINTER_UNSAFE) "You are attempting to retrieve a function pointer type. " "This is inherently unsafe in sol2. In order to do this, you must turn on the " "SOL_GET_FUNCTION_POINTER_UNSAFE configuration macro, as detailed in the documentation. " diff --git a/include/sol/function_types_stateful.hpp b/include/sol/function_types_stateful.hpp index 45c97b1b..2f777aaa 100644 --- a/include/sol/function_types_stateful.hpp +++ b/include/sol/function_types_stateful.hpp @@ -74,7 +74,7 @@ namespace sol { namespace function_detail { } static int call(lua_State* L, member_function& self) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -90,7 +90,7 @@ namespace sol { namespace function_detail { } int operator()(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) diff --git a/include/sol/function_types_stateless.hpp b/include/sol/function_types_stateless.hpp index 672732fa..b54d6c0e 100644 --- a/include/sol/function_types_stateless.hpp +++ b/include/sol/function_types_stateless.hpp @@ -35,7 +35,7 @@ namespace sol { namespace function_detail { using traits_type = meta::bind_traits; static int real_call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -70,7 +70,7 @@ namespace sol { namespace function_detail { typedef lua_bind_traits traits_type; static int real_call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -88,7 +88,7 @@ namespace sol { namespace function_detail { template static int call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -110,7 +110,7 @@ namespace sol { namespace function_detail { } int operator()(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -126,7 +126,7 @@ namespace sol { namespace function_detail { typedef lua_bind_traits traits_type; static int real_call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -153,7 +153,7 @@ namespace sol { namespace function_detail { template static int call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -175,7 +175,7 @@ namespace sol { namespace function_detail { } int operator()(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -191,7 +191,7 @@ namespace sol { namespace function_detail { typedef lua_bind_traits traits_type; static int real_call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -216,7 +216,7 @@ namespace sol { namespace function_detail { template static int call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -238,7 +238,7 @@ namespace sol { namespace function_detail { } int operator()(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -254,7 +254,7 @@ namespace sol { namespace function_detail { typedef lua_bind_traits traits_type; static int real_call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -268,7 +268,7 @@ namespace sol { namespace function_detail { template static int call(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) @@ -290,7 +290,7 @@ namespace sol { namespace function_detail { } int operator()(lua_State* L) -#if SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#if SOL_IS_ON(SOL_COMPILER_VCXX) // MSVC is broken, what a surprise... #else noexcept(traits_type::is_noexcept) diff --git a/include/sol/function_types_templated.hpp b/include/sol/function_types_templated.hpp index 2cc892a9..36ef72d1 100644 --- a/include/sol/function_types_templated.hpp +++ b/include/sol/function_types_templated.hpp @@ -121,7 +121,7 @@ namespace sol { typedef meta::unqualified_t Fu; typedef std::integral_constant::value -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) || std::is_same::value #endif > diff --git a/include/sol/load_result.hpp b/include/sol/load_result.hpp index 4bafd3ee..60c14b65 100644 --- a/include/sol/load_result.hpp +++ b/include/sol/load_result.hpp @@ -106,7 +106,7 @@ namespace sol { } else { if constexpr (std::is_same_v) { -#if SOL_IS_ON(SOL_SAFE_PROXIES_I_) +#if SOL_IS_ON(SOL_SAFE_PROXIES) if (valid()) { type_panic_c_str(L, index, type_of(L, index), type::none, "expecting an error type (a string, from Lua)"); } @@ -114,7 +114,7 @@ namespace sol { return error(detail::direct_error, stack::get(L, index)); } else { -#if SOL_IS_ON(SOL_SAFE_PROXIES_I_) +#if SOL_IS_ON(SOL_SAFE_PROXIES) if (!valid()) { type_panic_c_str(L, index, type_of(L, index), type::none); } diff --git a/include/sol/lua_table.hpp b/include/sol/lua_table.hpp index 05c5eb85..1dc4a543 100644 --- a/include/sol/lua_table.hpp +++ b/include/sol/lua_table.hpp @@ -50,7 +50,7 @@ namespace sol { } template >> = meta::enabler> basic_lua_table(lua_State* L, T&& r) : base_t(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -62,13 +62,13 @@ namespace sol { } } basic_lua_table(lua_State* L, int index = -1) : base_t(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_lua_table(lua_State* L, ref_index index) : base_t(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -78,7 +78,7 @@ namespace sol { meta::enable, basic_lua_table>>, meta::neg>, meta::neg>>, is_lua_reference>> = meta::enabler> basic_lua_table(T&& r) noexcept : basic_lua_table(detail::no_safety, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_table>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; diff --git a/include/sol/lua_value.hpp b/include/sol/lua_value.hpp index b2b8b6b1..e4f6d1e8 100644 --- a/include/sol/lua_value.hpp +++ b/include/sol/lua_value.hpp @@ -48,7 +48,7 @@ namespace sol { using is_lua_value_single_constructible = meta::any, is_reference_or_lua_value_init_list>; static lua_State*& thread_local_lua_state() { -#if SOL_IS_ON(SOL_USE_THREAD_LOCAL_I_) +#if SOL_IS_ON(SOL_USE_THREAD_LOCAL) static thread_local lua_State* L = nullptr; #else static lua_State* L = nullptr; diff --git a/include/sol/metatable.hpp b/include/sol/metatable.hpp index 78121293..a75b48be 100644 --- a/include/sol/metatable.hpp +++ b/include/sol/metatable.hpp @@ -86,20 +86,20 @@ namespace sol { } template >> = meta::enabler> basic_metatable(lua_State* L, T&& r) : base_t(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); #endif // Safety } basic_metatable(lua_State* L, int index = -1) : basic_metatable(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_metatable(lua_State* L, ref_index index) : basic_metatable(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -109,7 +109,7 @@ namespace sol { meta::enable, basic_metatable>>, meta::neg>, meta::neg>>, is_lua_reference>> = meta::enabler> basic_metatable(T&& r) noexcept : basic_metatable(detail::no_safety, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_table>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; diff --git a/include/sol/optional.hpp b/include/sol/optional.hpp index e7edc33d..a0f1ba26 100644 --- a/include/sol/optional.hpp +++ b/include/sol/optional.hpp @@ -27,7 +27,7 @@ #include #include #include -#if SOL_IS_ON(SOL_USE_BOOST_I_) +#if SOL_IS_ON(SOL_USE_BOOST) #include #else #include @@ -38,7 +38,7 @@ namespace sol { -#if SOL_IS_ON(SOL_USE_BOOST_I_) +#if SOL_IS_ON(SOL_USE_BOOST) template using optional = boost::optional; using nullopt_t = boost::none_t; @@ -59,14 +59,14 @@ namespace sol { inline static constexpr std::nullopt_t value = std::nullopt; }; -#if SOL_IS_ON(SOL_USE_BOOST_I_) +#if SOL_IS_ON(SOL_USE_BOOST) template struct associated_nullopt> { inline static SOL_BOOST_NONE_CONSTEXPR_I_ boost::none_t value = boost::none; }; #endif // Boost nullopt -#if SOL_IS_ON(SOL_USE_BOOST_I_) +#if SOL_IS_ON(SOL_USE_BOOST) template inline SOL_BOOST_NONE_CONSTEXPR_I_ auto associated_nullopt_v = associated_nullopt::value; #else @@ -76,7 +76,7 @@ namespace sol { } // namespace detail } // namespace sol -#if SOL_IS_ON(SOL_USE_BOOST_I_) +#if SOL_IS_ON(SOL_USE_BOOST) #undef SOL_BOOST_NONE_CONSTEXPR_I_ #endif diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp index b7673b17..03afd8c1 100644 --- a/include/sol/optional_implementation.hpp +++ b/include/sol/optional_implementation.hpp @@ -1375,7 +1375,7 @@ namespace sol { SOL_TL_OPTIONAL_11_CONSTEXPR T& value() & { if (has_value()) return this->m_value; -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) std::abort(); #else throw bad_optional_access(); @@ -1386,7 +1386,7 @@ namespace sol { SOL_TL_OPTIONAL_11_CONSTEXPR const T& value() const& { if (has_value()) return this->m_value; -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) std::abort(); #else throw bad_optional_access(); @@ -1396,7 +1396,7 @@ namespace sol { SOL_TL_OPTIONAL_11_CONSTEXPR T&& value() && { if (has_value()) return std::move(this->m_value); -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) std::abort(); #else throw bad_optional_access(); @@ -1408,7 +1408,7 @@ namespace sol { SOL_TL_OPTIONAL_11_CONSTEXPR const T&& value() const&& { if (has_value()) return std::move(this->m_value); -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) std::abort(); #else throw bad_optional_access(); @@ -2250,7 +2250,7 @@ namespace sol { SOL_TL_OPTIONAL_11_CONSTEXPR T& value() { if (has_value()) return *m_value; -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) std::abort(); #else throw bad_optional_access(); @@ -2261,7 +2261,7 @@ namespace sol { SOL_TL_OPTIONAL_11_CONSTEXPR const T& value() const { if (has_value()) return *m_value; -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) std::abort(); #else throw bad_optional_access(); diff --git a/include/sol/packaged_coroutine.hpp b/include/sol/packaged_coroutine.hpp index 0f242306..642c6208 100644 --- a/include/sol/packaged_coroutine.hpp +++ b/include/sol/packaged_coroutine.hpp @@ -96,7 +96,7 @@ namespace sol { meta::neg>>, is_lua_reference>> = meta::enabler> basic_packaged_coroutine(T&& r) noexcept : base_t(std::forward(r)), m_error_handler(detail::get_default_handler::value>(r.lua_state())) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_function>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; @@ -160,7 +160,7 @@ namespace sol { } template >> = meta::enabler> basic_packaged_coroutine(lua_State* L, T&& r, handler_t eh) : base_t(L, std::forward(r)), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -183,7 +183,7 @@ namespace sol { : basic_packaged_coroutine(L, index, detail::get_default_handler::value>(L)) { } basic_packaged_coroutine(lua_State* L, absolute_index index, handler_t eh) : base_t(L, index), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety @@ -192,7 +192,7 @@ namespace sol { : basic_packaged_coroutine(L, index, detail::get_default_handler::value>(L)) { } basic_packaged_coroutine(lua_State* L, raw_index index, handler_t eh) : base_t(L, index), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety @@ -201,7 +201,7 @@ namespace sol { : basic_packaged_coroutine(L, index, detail::get_default_handler::value>(L)) { } basic_packaged_coroutine(lua_State* L, ref_index index, handler_t eh) : base_t(L, index), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); diff --git a/include/sol/prologue.hpp b/include/sol/prologue.hpp index 1829aaa2..0c9fec3f 100644 --- a/include/sol/prologue.hpp +++ b/include/sol/prologue.hpp @@ -32,10 +32,10 @@ #define SOL_PROLOGUE_I_ 1 -#if SOL_IS_ON(SOL_BUILD_CXX_MODE_I_) +#if SOL_IS_ON(SOL_BUILD_CXX_MODE) #define _FWD(...) static_cast( __VA_ARGS__ ) - #if SOL_IS_ON(SOL_COMPILER_GCC_I_) || SOL_IS_ON(SOL_COMPILER_CLANG_I_) + #if SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define _MOVE(...) static_cast<__typeof( __VA_ARGS__ )&&>( __VA_ARGS__ ) #else #include diff --git a/include/sol/protected_function.hpp b/include/sol/protected_function.hpp index c3e6c66a..9b4298c0 100644 --- a/include/sol/protected_function.hpp +++ b/include/sol/protected_function.hpp @@ -75,7 +75,7 @@ namespace sol { meta::neg>>, meta::neg>, meta::neg>>, is_lua_reference>> = meta::enabler> basic_protected_function(T&& r) noexcept : base_t(std::forward(r)), m_error_handler(get_default_handler(r.lua_state())) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_function>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; @@ -133,7 +133,7 @@ namespace sol { } template >> = meta::enabler> basic_protected_function(lua_State* L_, T&& r, handler_t eh) : base_t(L_, std::forward(r)), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -146,7 +146,7 @@ namespace sol { basic_protected_function(lua_State* L_, int index_ = -1) : basic_protected_function(L_, index_, get_default_handler(L_)) { } basic_protected_function(lua_State* L_, int index_, handler_t eh) : base_t(L_, index_), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L_, index_, handler); #endif // Safety @@ -154,7 +154,7 @@ namespace sol { basic_protected_function(lua_State* L_, absolute_index index_) : basic_protected_function(L_, index_, get_default_handler(L_)) { } basic_protected_function(lua_State* L_, absolute_index index_, handler_t eh) : base_t(L_, index_), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L_, index_, handler); #endif // Safety @@ -162,7 +162,7 @@ namespace sol { basic_protected_function(lua_State* L_, raw_index index_) : basic_protected_function(L_, index_, get_default_handler(L_)) { } basic_protected_function(lua_State* L_, raw_index index_, handler_t eh) : base_t(L_, index_), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L_, index_, handler); #endif // Safety @@ -170,7 +170,7 @@ namespace sol { basic_protected_function(lua_State* L_, ref_index index_) : basic_protected_function(L_, index_, get_default_handler(L_)) { } basic_protected_function(lua_State* L_, ref_index index_, handler_t eh) : base_t(L_, index_), m_error_handler(std::move(eh)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -339,14 +339,14 @@ namespace sol { int firstreturn = 1; int returncount = 0; call_status code = call_status::ok; -#if SOL_IS_ON(SOL_EXCEPTIONS_I_) && SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS) && SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS) try { #endif // No Exceptions firstreturn = (std::max)(1, static_cast(stacksize - n - static_cast(h.valid() && !is_stack_handler_v))); code = luacall(n, LUA_MULTRET, h); poststacksize = lua_gettop(lua_state()) - static_cast(h.valid() && !is_stack_handler_v); returncount = poststacksize - (firstreturn - 1); -#if SOL_IS_ON(SOL_EXCEPTIONS_I_) && SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS) && SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS) } // Handle C++ errors thrown from C++ functions bound inside of lua catch (const char* error) { @@ -364,7 +364,7 @@ namespace sol { firstreturn = lua_gettop(lua_state()); return protected_function_result(lua_state(), firstreturn, 0, 1, call_status::runtime); } -#if SOL_IS_ON(SOL_EXCEPTIONS_CATCH_ALL_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS_CATCH_ALL) // LuaJIT cannot have the catchall when the safe propagation is on // but LuaJIT will swallow all C++ errors // if we don't at least catch std::exception ones diff --git a/include/sol/protected_function_result.hpp b/include/sol/protected_function_result.hpp index 52c78231..d806177e 100644 --- a/include/sol/protected_function_result.hpp +++ b/include/sol/protected_function_result.hpp @@ -120,7 +120,7 @@ namespace sol { } else { if constexpr (std::is_same_v) { -#if SOL_IS_ON(SOL_SAFE_PROXIES_I_) +#if SOL_IS_ON(SOL_SAFE_PROXIES) if (valid()) { type t = type_of(L, target); type_panic_c_str(L, target, t, type::none, "bad get from protected_function_result (is an error)"); @@ -129,7 +129,7 @@ namespace sol { return error(detail::direct_error, stack::get(L, target)); } else { -#if SOL_IS_ON(SOL_SAFE_PROXIES_I_) +#if SOL_IS_ON(SOL_SAFE_PROXIES) if (!valid()) { type t = type_of(L, target); type_panic_c_str(L, target, t, type::none, "bad get from protected_function_result (is not an error)"); @@ -216,7 +216,7 @@ namespace sol { template <> struct unqualified_pusher { static int push(lua_State* L, const protected_function_result& pfr) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, static_cast(pfr.pop_count()), detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow int p = 0; diff --git a/include/sol/protected_handler.hpp b/include/sol/protected_handler.hpp index 6d40640f..6f1bd744 100644 --- a/include/sol/protected_handler.hpp +++ b/include/sol/protected_handler.hpp @@ -92,7 +92,7 @@ namespace sol { namespace detail { return; } if (!ref.valid()) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushnil(L); diff --git a/include/sol/reference.hpp b/include/sol/reference.hpp index ed296f66..39c538ef 100644 --- a/include/sol/reference.hpp +++ b/include/sol/reference.hpp @@ -289,7 +289,7 @@ namespace sol { } stateless_reference(lua_State* L_, global_tag_t) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push this reference value"); #endif // make sure stack doesn't overflow lua_pushglobaltable(L_); @@ -352,7 +352,7 @@ namespace sol { } stateless_reference(lua_State* L_, int index = -1) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push this reference value"); #endif // make sure stack doesn't overflow lua_pushvalue(L_, index); @@ -383,7 +383,7 @@ namespace sol { } int push(lua_State* L_) const noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push this reference value"); #endif // make sure stack doesn't overflow lua_rawgeti(L_, LUA_REGISTRYINDEX, ref); @@ -407,7 +407,7 @@ namespace sol { void reset(lua_State* L_, int index_) noexcept { reset(L_); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push this reference value"); #endif // make sure stack doesn't overflow lua_pushvalue(L_, index_); @@ -616,7 +616,7 @@ namespace sol { } basic_reference(lua_State* L_, int index = -1) noexcept : luastate(detail::pick_main_thread(L_, L_)) { // use L_ to stick with that state's execution stack -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push this reference value"); #endif // make sure stack doesn't overflow lua_pushvalue(L_, index); @@ -693,7 +693,7 @@ namespace sol { } int push(lua_State* L_) const noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push this reference value"); #endif // make sure stack doesn't overflow if (lua_state() == nullptr) { diff --git a/include/sol/sol.hpp b/include/sol/sol.hpp index dc300883..f492ed98 100644 --- a/include/sol/sol.hpp +++ b/include/sol/sol.hpp @@ -24,23 +24,23 @@ #include -#if SOL_IS_ON(SOL_INSIDE_UNREAL_ENGINE_I_) +#if SOL_IS_ON(SOL_INSIDE_UNREAL_ENGINE) #ifdef check #pragma push_macro("check") #undef check #endif #endif // Unreal Engine 4 Bullshit -#if SOL_IS_ON(SOL_COMPILER_GCC_I_) +#if SOL_IS_ON(SOL_COMPILER_GCC) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wconversion" #if __GNUC__ > 6 #pragma GCC diagnostic ignored "-Wnoexcept-type" #endif -#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) +#elif SOL_IS_ON(SOL_COMPILER_CLANG) // we'll just let this alone for now -#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#elif SOL_IS_ON(SOL_COMPILER_VCXX) #pragma warning(push) #pragma warning(disable : 4505) // unreferenced local function has been removed GEE THANKS #endif // clang++ vs. g++ vs. VC++ @@ -65,13 +65,15 @@ #include #include -#if SOL_IS_ON(SOL_COMPILER_GCC_I_) +#if SOL_IS_ON(SOL_COMPILER_GCC) #pragma GCC diagnostic pop -#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#elif SOL_IS_ON(SOL_COMPILER_CLANG) +// we'll just let this alone for now +#elif SOL_IS_ON(SOL_COMPILER_VCXX) #pragma warning(pop) #endif // g++ -#if SOL_IS_ON(SOL_INSIDE_UNREAL_ENGINE_I_) +#if SOL_IS_ON(SOL_INSIDE_UNREAL_ENGINE) #undef check #pragma pop_macro("check") #endif // Unreal Engine 4 Bullshit diff --git a/include/sol/stack.hpp b/include/sol/stack.hpp index faf468d8..971db3d7 100644 --- a/include/sol/stack.hpp +++ b/include/sol/stack.hpp @@ -149,7 +149,7 @@ namespace sol { template static decltype(auto) eval(types, std::index_sequence, lua_State* L_, int start_index_, Handler&& handler_, record& tracking_, Fx&& fx_, FxArgs&&... fxargs_) { -#if SOL_IS_ON(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_PROPAGATE_EXCEPTIONS) // We can save performance/time by letting errors unwind produced arguments // rather than checking everything once, and then potentially re-doing work if constexpr (checked) { @@ -186,7 +186,7 @@ namespace sol { "a reference and std::move it manually if this was your intention."); argument_handler> handler {}; record tracking {}; -#if SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS) if constexpr (checkargs) { multi_check(L_, start_index_, handler); } @@ -319,11 +319,11 @@ namespace sol { } inline void luajit_exception_handler(lua_State* L, int (*handler)(lua_State*, lua_CFunction) = detail::c_trampoline) { -#if SOL_IS_ON(SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE_I_) +#if SOL_IS_ON(SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE) if (L == nullptr) { return; } -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushlightuserdata(L, (void*)handler); @@ -336,7 +336,7 @@ namespace sol { } inline void luajit_exception_off(lua_State* L) { -#if SOL_IS_ON(SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE_I_) +#if SOL_IS_ON(SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE) if (L == nullptr) { return; } diff --git a/include/sol/stack_check_get_unqualified.hpp b/include/sol/stack_check_get_unqualified.hpp index 31bef9f4..96ad2fab 100644 --- a/include/sol/stack_check_get_unqualified.hpp +++ b/include/sol/stack_check_get_unqualified.hpp @@ -32,7 +32,7 @@ #include #include #include -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // variant shenanigans (thanks, Mac OSX) @@ -76,7 +76,7 @@ namespace sol { namespace stack { int isnum = 0; const lua_Number value = lua_tonumberx(L, index, &isnum); if (isnum != 0) { -#if SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS_I_) +#if SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS) const auto integer_value = llround(value); if (static_cast(integer_value) == value) { tracking.use(1); @@ -139,7 +139,7 @@ namespace sol { namespace stack { } }; -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) template struct unqualified_check_getter, C> { typedef std::variant V; diff --git a/include/sol/stack_check_unqualified.hpp b/include/sol/stack_check_unqualified.hpp index cd132e0c..48ae6727 100644 --- a/include/sol/stack_check_unqualified.hpp +++ b/include/sol/stack_check_unqualified.hpp @@ -32,7 +32,7 @@ #include #include #include -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // variant shenanigans @@ -116,7 +116,7 @@ namespace sol { namespace stack { } else if constexpr (meta::any_same_v= 503 // Lua 5.3 and greater checks for numeric precision -#if SOL_IS_ON(SOL_STRINGS_ARE_NUMBERS_I_) +#if SOL_IS_ON(SOL_STRINGS_ARE_NUMBERS) // imprecise, sloppy conversions int isnum = 0; lua_tointegerx(L_, index, &isnum); @@ -138,7 +138,7 @@ namespace sol { namespace stack { // expected type, actual type handler(L_, index, type::number, type_of(L_, index), detail::not_a_number_or_number_string_integral); } -#elif SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS_I_) +#elif SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS) // this check is precise, do not convert if (lua_isinteger(L_, index) == 1) { return true; @@ -160,7 +160,7 @@ namespace sol { namespace stack { return success; #else // Lua 5.2 and below checks -#if SOL_IS_OFF(SOL_STRINGS_ARE_NUMBERS_I_) +#if SOL_IS_OFF(SOL_STRINGS_ARE_NUMBERS) // must pre-check, because it will convert type t = type_of(L_, index); if (t != type::number) { @@ -170,7 +170,7 @@ namespace sol { namespace stack { } #endif // Do not allow strings to be numbers -#if SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS_I_) +#if SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS) int isnum = 0; const lua_Number v = lua_tonumberx(L_, index, &isnum); const bool success = isnum != 0 && static_cast(llround(v)) == v; @@ -179,9 +179,9 @@ namespace sol { namespace stack { #endif // Safe numerics and number precision checking if (!success) { // Use defines to provide a better error message! -#if SOL_IS_ON(SOL_STRINGS_ARE_NUMBERS_I_) +#if SOL_IS_ON(SOL_STRINGS_ARE_NUMBERS) handler(L_, index, type::number, type_of(L_, index), detail::not_a_number_or_number_string); -#elif SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS_I_) +#elif SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS) handler(L_, index, type::number, t, detail::not_a_number_or_number_string); #else handler(L_, index, type::number, t, detail::not_a_number); @@ -192,7 +192,7 @@ namespace sol { namespace stack { } else if constexpr (std::is_floating_point_v || std::is_same_v) { tracking.use(1); -#if SOL_IS_ON(SOL_STRINGS_ARE_NUMBERS_I_) +#if SOL_IS_ON(SOL_STRINGS_ARE_NUMBERS) bool success = lua_isnumber(L_, index) == 1; if (!success) { // expected type, actual type @@ -371,7 +371,7 @@ namespace sol { namespace stack { } return stack::unqualified_check(L_, index, &no_panic, tracking); } -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) else if constexpr (std::is_function_v || (std::is_pointer_v && std::is_function_v>)) { return stack_detail::check_function_pointer>(L_, index, std::forward(handler), tracking); } @@ -508,13 +508,13 @@ namespace sol { namespace stack { return true; } else { -#if SOL_IS_ON(SOL_USE_INTEROP_I_) +#if SOL_IS_ON(SOL_USE_INTEROP) if (stack_detail::interop_check(L_, index, indextype, handler, tracking)) { return true; } #endif // interop extensibility tracking.use(1); -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) if (lua_iscfunction(L_, index) != 0) { // a potential match... return true; @@ -539,7 +539,7 @@ namespace sol { namespace stack { bool success = false; bool has_derived = derive::value || weak_derive::value; if (has_derived) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow auto pn = stack::pop_n(L_, 1); @@ -595,7 +595,7 @@ namespace sol { namespace stack { } }; -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) template struct unqualified_checker, type::poly> { diff --git a/include/sol/stack_core.hpp b/include/sol/stack_core.hpp index 75a406f8..eca4f969 100644 --- a/include/sol/stack_core.hpp +++ b/include/sol/stack_core.hpp @@ -127,7 +127,7 @@ namespace sol { inline void* align_usertype_pointer(void* ptr) { using use_align = std::integral_constant::value > 1) @@ -143,7 +143,7 @@ namespace sol { template void* align_usertype_unique_destructor(void* ptr) { using use_align = std::integral_constant::value > 1) @@ -165,7 +165,7 @@ namespace sol { template void* align_usertype_unique_tag(void* ptr) { using use_align = std::integral_constant::value > 1) @@ -187,7 +187,7 @@ namespace sol { template void* align_usertype_unique(void* ptr) { typedef std::integral_constant > 1) @@ -210,7 +210,7 @@ namespace sol { template void* align_user(void* ptr) { typedef std::integral_constant > 1) @@ -227,7 +227,7 @@ namespace sol { template T** usertype_allocate_pointer(lua_State* L) { typedef std::integral_constant::value > 1) @@ -311,7 +311,7 @@ namespace sol { template T* usertype_allocate(lua_State* L) { typedef std::integral_constant::value > 1 || std::alignment_of_v > 1) @@ -352,7 +352,7 @@ namespace sol { template Real* usertype_unique_allocate(lua_State* L, T**& pref, unique_destructor*& dx, unique_tag*& id) { typedef std::integral_constant::value > 1 || std::alignment_of::value > 1 || std::alignment_of::value > 1 @@ -406,7 +406,7 @@ namespace sol { template T* user_allocate(lua_State* L) { typedef std::integral_constant > 1) @@ -928,7 +928,7 @@ namespace sol { using use_reference_tag = meta::all< meta::neg> -#if SOL_IS_OFF(SOL_FUNCTION_CALL_VALUE_SEMANTICS_I_) +#if SOL_IS_OFF(SOL_FUNCTION_CALL_VALUE_SEMANTICS) , std::is_lvalue_reference, meta::neg>>, meta::neg>>, @@ -1145,7 +1145,7 @@ namespace sol { template auto unqualified_get(lua_State* L, int index, record& tracking) -> decltype(stack_detail::unchecked_unqualified_get(L, index, tracking)) { -#if SOL_IS_ON(SOL_SAFE_GETTER_I_) +#if SOL_IS_ON(SOL_SAFE_GETTER) static constexpr bool is_op = meta::is_optional_v; if constexpr (is_op) { return stack_detail::unchecked_unqualified_get(L, index, tracking); @@ -1170,7 +1170,7 @@ namespace sol { template auto get(lua_State* L, int index, record& tracking) -> decltype(stack_detail::unchecked_get(L, index, tracking)) { -#if SOL_IS_ON(SOL_SAFE_GETTER_I_) +#if SOL_IS_ON(SOL_SAFE_GETTER) static constexpr bool is_op = meta::is_optional_v; if constexpr (is_op) { return stack_detail::unchecked_get(L, index, tracking); diff --git a/include/sol/stack_get_unqualified.hpp b/include/sol/stack_get_unqualified.hpp index 58ee34f5..b9976d93 100644 --- a/include/sol/stack_get_unqualified.hpp +++ b/include/sol/stack_get_unqualified.hpp @@ -37,7 +37,7 @@ #include #include #include -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // Apple clang screwed up @@ -169,7 +169,7 @@ namespace sol { namespace stack { luaL_Stream* pstream = static_cast(lua_touserdata(L, index)); return *pstream; } -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) else if constexpr (std::is_function_v || (std::is_pointer_v && std::is_function_v>)) { return stack_detail::get_function_pointer>(L, index, tracking); } @@ -210,7 +210,7 @@ namespace sol { namespace stack { } actual r {}; if constexpr (!derive::value) { -#if SOL_IS_ON(SOL_DEBUG_BUILD_I_) +#if SOL_IS_ON(SOL_DEBUG_BUILD) // In debug mode we would rather abort you for this grave failure rather // than let you deref a null pointer and fuck everything over std::abort(); @@ -247,7 +247,7 @@ namespace sol { namespace stack { // uh oh.. break; } -#if SOL_IS_ON(SOL_DEBUG_BUILD_I_) +#if SOL_IS_ON(SOL_DEBUG_BUILD) // In debug mode we would rather abort you for this grave failure rather // than let you deref a null pointer and fuck everything over std::abort(); @@ -355,8 +355,8 @@ namespace sol { namespace stack { } bool isnil = false; for (int vi = 0; vi < lua_size::value; ++vi) { -#if SOL_IS_ON(SOL_LUA_NIL_IN_TABLES_I_) && SOL_LUA_VERSION_I_ >= 600 -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_LUA_NIL_IN_TABLES) && SOL_LUA_VERSION_I_ >= 600 +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushinteger(L, static_cast(i + vi)); @@ -376,7 +376,7 @@ namespace sol { namespace stack { if (i == 0) { break; } -#if SOL_IS_ON(SOL_LUA_NIL_IN_TABLES_I_) && SOL_LUA_VERSION_I_ >= 600 +#if SOL_IS_ON(SOL_LUA_NIL_IN_TABLES) && SOL_LUA_VERSION_I_ >= 600 lua_pop(L, vi); #else lua_pop(L, (vi + 1)); @@ -386,7 +386,7 @@ namespace sol { namespace stack { } } if (isnil) { -#if SOL_IS_ON(SOL_LUA_NIL_IN_TABLES_I_) && SOL_LUA_VERSION_I_ >= 600 +#if SOL_IS_ON(SOL_LUA_NIL_IN_TABLES) && SOL_LUA_VERSION_I_ >= 600 #else lua_pop(L, lua_size::value); #endif @@ -404,7 +404,7 @@ namespace sol { namespace stack { // see above comment goto done; } -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 2, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow bool isnil = false; @@ -443,7 +443,7 @@ namespace sol { namespace stack { static T get(types, lua_State* L, int relindex, record& tracking) { tracking.use(1); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 3, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow @@ -486,7 +486,7 @@ namespace sol { namespace stack { template static C get(types, lua_State* L, int relindex, record& tracking) { tracking.use(1); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 3, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow @@ -551,7 +551,7 @@ namespace sol { namespace stack { static C get(types, lua_State* L, int relindex, record& tracking) { tracking.use(1); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 3, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow @@ -883,7 +883,7 @@ namespace sol { namespace stack { struct unqualified_getter> { static T* get_no_lua_nil(lua_State* L, int index, record& tracking) { void* memory = lua_touserdata(L, index); -#if SOL_IS_ON(SOL_USE_INTEROP_I_) +#if SOL_IS_ON(SOL_USE_INTEROP) auto ugr = stack_detail::interop_get(L, index, memory, tracking); if (ugr.first) { return ugr.second; @@ -973,7 +973,7 @@ namespace sol { namespace stack { template struct unqualified_getter { static T* get(lua_State* L, int index, record& tracking) { -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) if constexpr (std::is_function_v) { return stack_detail::get_function_pointer(L, index, tracking); } @@ -1022,7 +1022,7 @@ namespace sol { namespace stack { } }; -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) template struct unqualified_getter> { diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 098fa0a0..9e35eec8 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -37,7 +37,7 @@ #include #include #include -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // Can use variant @@ -52,7 +52,7 @@ namespace sol { namespace stack { constexpr bool is_same_signedness = (std::is_signed_v && std::is_signed_v) || (std::is_unsigned_v && std::is_unsigned_v); constexpr bool probaby_fits_within_lua_Integer = sizeof(T) == sizeof(lua_Integer) -#if SOL_IS_ON(SOL_ALL_INTEGER_VALUES_FIT_I_) +#if SOL_IS_ON(SOL_ALL_INTEGER_VALUES_FIT) && ((std::has_unique_object_representations_v && std::has_unique_object_representations_v) ? true : is_same_signedness) #else && is_same_signedness @@ -75,7 +75,7 @@ namespace sol { namespace stack { int msvc_is_ass_with_if_constexpr_push_enum(std::true_type, lua_State* L, const T& value) { if constexpr (meta::any_same_v, char -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) , char8_t #endif @@ -101,7 +101,7 @@ namespace sol { namespace stack { } // namespace stack_detail inline int push_environment_of(lua_State* L, int target_index = -1) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_environment); #endif // make sure stack doesn't overflow #if SOL_LUA_VERSION_I_ < 502 @@ -148,7 +148,7 @@ namespace sol { namespace stack { struct unqualified_pusher> { template static int push_fx(lua_State* L, F&& f, Args&&... args) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_userdata); #endif // make sure stack doesn't overflow // Basically, we store all user-data like this: @@ -193,7 +193,7 @@ namespace sol { namespace stack { static int push_fx(lua_State* L, F&& f, T* obj) { if (obj == nullptr) return stack::push(L, lua_nil); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_userdata); #endif // make sure stack doesn't overflow T** pref = detail::usertype_allocate_pointer(L); @@ -249,7 +249,7 @@ namespace sol { namespace stack { template static int push_deep(lua_State* L, Args&&... args) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_userdata); #endif // make sure stack doesn't overflow element** pointer_to_memory = nullptr; @@ -295,7 +295,7 @@ namespace sol { namespace stack { return p[0]; } else if constexpr (std::is_same_v) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushboolean(L, std::forward(args)...); @@ -303,7 +303,7 @@ namespace sol { namespace stack { } else if constexpr (std::is_integral_v || std::is_same_v) { const Tu& value(std::forward(args)...); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_integral); #endif // make sure stack doesn't overflow #if SOL_LUA_VERSION_I_ >= 503 @@ -312,9 +312,9 @@ namespace sol { namespace stack { return 1; } #endif // Lua 5.3 and above -#if SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS_I_) +#if SOL_IS_ON(SOL_NUMBER_PRECISION_CHECKS) if (static_cast(llround(static_cast(value))) != value) { -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) // Is this really worth it? assert(false && "integer value will be misrepresented in lua"); lua_pushinteger(L, static_cast(value)); @@ -328,7 +328,7 @@ namespace sol { namespace stack { return 1; } else if constexpr (std::is_floating_point_v || std::is_same_v) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_floating); #endif // make sure stack doesn't overflow lua_pushnumber(L, std::forward(args)...); @@ -338,7 +338,7 @@ namespace sol { namespace stack { luaL_Stream* source { std::forward(args)... }; luaL_Stream* stream = static_cast(detail::alloc_newuserdata(L, sizeof(luaL_Stream))); stream->f = source->f; -#if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_) +#if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION) stream->closef = source->closef; #endif // LuaJIT and Lua 5.1 and below do not have return 1; @@ -347,7 +347,7 @@ namespace sol { namespace stack { luaL_Stream& source(std::forward(args)...); luaL_Stream* stream = static_cast(detail::alloc_newuserdata(L, sizeof(luaL_Stream))); stream->f = source.f; -#if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_) +#if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION) stream->closef = source.closef; #endif // LuaJIT and Lua 5.1 and below do not have return 1; @@ -423,7 +423,7 @@ namespace sol { namespace stack { lua_seti(L, tableindex, static_cast(index++)); } #else -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushinteger(L, static_cast(index)); @@ -436,7 +436,7 @@ namespace sol { namespace stack { int firstindex = tableindex + 1 + 1; for (int pi = 0; pi < p; ++pi) { stack::push(L, index); -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushvalue(L, firstindex); @@ -515,7 +515,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, lua_nil_t) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushnil(L); @@ -533,7 +533,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, metatable_key_t) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushlstring(L, to_string(meta_function::metatable).c_str(), 4); @@ -544,7 +544,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher> { static int push(lua_State* L, lua_CFunction func, int n = 0) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushcclosure(L, func, n); @@ -555,7 +555,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, lua_CFunction func, int n = 0) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushcclosure(L, func, n); @@ -563,11 +563,11 @@ namespace sol { namespace stack { } }; -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) template <> struct unqualified_pusher> { static int push(lua_State* L, detail::lua_CFunction_noexcept func, int n = 0) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushcclosure(L, func, n); @@ -578,7 +578,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, detail::lua_CFunction_noexcept func, int n = 0) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushcclosure(L, func, n); @@ -590,7 +590,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, c_closure cc) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushcclosure(L, cc.c_function, cc.upvalues); @@ -616,7 +616,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, void* userdata) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushlightuserdata(L, userdata); @@ -627,7 +627,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, const void* userdata) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushlightuserdata(L, const_cast(userdata)); @@ -638,7 +638,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, lightuserdata_value userdata) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushlightuserdata(L, userdata); @@ -649,7 +649,7 @@ namespace sol { namespace stack { template struct unqualified_pusher> { static int push(lua_State* L, light l) noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushlightuserdata(L, static_cast(l.value)); @@ -661,14 +661,14 @@ namespace sol { namespace stack { struct unqualified_pusher> { template static int push_with(lua_State* L, Key&& name, Args&&... args) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_userdata); #endif // make sure stack doesn't overflow // A dumb pusher T* data = detail::user_allocate(L); if (with_meta) { // Make sure we have a plain GC set for this data -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow if (luaL_newmetatable(L, name) != 0) { @@ -724,7 +724,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, userdata_value data) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_userdata); #endif // make sure stack doesn't overflow void** ud = detail::usertype_allocate_pointer(L); @@ -736,7 +736,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push_sized(lua_State* L, const char* str, std::size_t len) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, str, len); @@ -788,7 +788,7 @@ namespace sol { namespace stack { template struct unqualified_pusher { static int push(lua_State* L, const char (&str)[N]) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, str, std::char_traits::length(str)); @@ -796,7 +796,7 @@ namespace sol { namespace stack { } static int push(lua_State* L, const char (&str)[N], std::size_t sz) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, str, sz); @@ -812,11 +812,11 @@ namespace sol { namespace stack { } }; -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) template <> struct unqualified_pusher { static int push_sized(lua_State* L, const char8_t* str, std::size_t len) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, reinterpret_cast(str), len); @@ -868,7 +868,7 @@ namespace sol { namespace stack { template struct unqualified_pusher { static int push(lua_State* L, const char8_t (&str)[N]) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow const char* str_as_char = reinterpret_cast(static_cast(str)); @@ -877,7 +877,7 @@ namespace sol { namespace stack { } static int push(lua_State* L, const char8_t (&str)[N], std::size_t sz) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, str, sz); @@ -902,7 +902,7 @@ namespace sol { namespace stack { return stack::push(L, str.data(), str.size()); } else { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, str.c_str(), str.size()); @@ -915,7 +915,7 @@ namespace sol { namespace stack { return stack::push(L, str.data(), sz); } else { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_string); #endif // make sure stack doesn't overflow lua_pushlstring(L, str.c_str(), sz); @@ -938,7 +938,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, meta_function m) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_meta_function_name); #endif // make sure stack doesn't overflow const std::string& str = to_string(m); @@ -950,7 +950,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, absolute_index ai) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushvalue(L, ai); @@ -961,7 +961,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, raw_index ri) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_pushvalue(L, ri); @@ -972,7 +972,7 @@ namespace sol { namespace stack { template <> struct unqualified_pusher { static int push(lua_State* L, ref_index ri) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow lua_rawgeti(L, LUA_REGISTRYINDEX, ri); @@ -1244,7 +1244,7 @@ namespace sol { namespace stack { struct unqualified_pusher> { template static int push(std::index_sequence, lua_State* L, T&& t) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, static_cast(sizeof...(I)), detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow int pushcount = 0; @@ -1348,7 +1348,7 @@ namespace sol { namespace stack { } }; -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) namespace stack_detail { struct push_function { diff --git a/include/sol/stack_reference.hpp b/include/sol/stack_reference.hpp index 18b987d6..55861879 100644 --- a/include/sol/stack_reference.hpp +++ b/include/sol/stack_reference.hpp @@ -70,7 +70,7 @@ namespace sol { stateless_stack_reference& operator=(const stateless_stack_reference&) noexcept = default; int push(lua_State* L_) const noexcept { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L_, 1, "not enough Lua stack space to push a single reference value"); #endif // make sure stack doesn't overflow lua_pushvalue(L_, m_index); @@ -153,7 +153,7 @@ namespace sol { } int i = r.stack_index(); if (detail::xmovable(lua_state(), r.lua_state())) { -#if SOL_IS_ON(SOL_SAFE_STACK_CHECK_I_) +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, "not enough Lua stack space to push a single reference value"); #endif // make sure stack doesn't overflow lua_pushvalue(r.lua_state(), r.stack_index()); diff --git a/include/sol/state_handling.hpp b/include/sol/state_handling.hpp index 52bfd527..e6b97d52 100644 --- a/include/sol/state_handling.hpp +++ b/include/sol/state_handling.hpp @@ -31,7 +31,7 @@ #include #include -#if SOL_IS_ON(SOL_PRINT_ERRORS_I_) +#if SOL_IS_ON(SOL_PRINT_ERRORS) #include #endif @@ -51,7 +51,7 @@ namespace sol { } inline int default_at_panic(lua_State* L) { -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) (void)L; return -1; #else @@ -60,7 +60,7 @@ namespace sol { if (message) { std::string err(message, messagesize); lua_settop(L, 0); -#if SOL_IS_ON(SOL_PRINT_ERRORS_I_) +#if SOL_IS_ON(SOL_PRINT_ERRORS) std::cerr << "[sol2] An error occurred and panic has been invoked: "; std::cerr << err; std::cerr << std::endl; @@ -85,7 +85,7 @@ namespace sol { const string_view& traceback = maybetraceback.value(); msg.assign(traceback.data(), traceback.size()); } -#if SOL_IS_ON(SOL_PRINT_ERRORS_I_) +#if SOL_IS_ON(SOL_PRINT_ERRORS) // std::cerr << "[sol2] An error occurred and was caught in traceback: "; // std::cerr << msg; // std::cerr << std::endl; @@ -120,7 +120,7 @@ namespace sol { std::string err = "sol: "; err += to_string(result.status()); err += " error"; -#if SOL_IS_ON(SOL_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS) std::exception_ptr eptr = std::current_exception(); if (eptr) { err += " with a "; @@ -149,7 +149,7 @@ namespace sol { string_view serr = stack::unqualified_get(L, result.stack_index()); err.append(serr.data(), serr.size()); } -#if SOL_IS_ON(SOL_PRINT_ERRORS_I_) +#if SOL_IS_ON(SOL_PRINT_ERRORS) std::cerr << "[sol2] An error occurred and has been passed to an error handler: "; std::cerr << err; std::cerr << std::endl; @@ -165,7 +165,7 @@ namespace sol { if (towards != 0) { lua_rotate(L, top, towards); } -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) return result; #else // just throw our error @@ -174,7 +174,7 @@ namespace sol { } inline protected_function_result script_default_on_error(lua_State* L, protected_function_result pfr) { -#if SOL_IS_ON(SOL_DEFAULT_PASS_ON_ERROR_I_) +#if SOL_IS_ON(SOL_DEFAULT_PASS_ON_ERROR) return script_pass_on_error(L, std::move(pfr)); #else return script_throw_on_error(L, std::move(pfr)); diff --git a/include/sol/state_view.hpp b/include/sol/state_view.hpp index 6cbcf118..06983729 100644 --- a/include/sol/state_view.hpp +++ b/include/sol/state_view.hpp @@ -129,7 +129,7 @@ namespace sol { for (auto&& library : libraries) { switch (library) { -#if SOL_LUA_VERSION_I_ <= 501 && SOL_IS_ON(SOL_USE_LUAJIT_I_) +#if SOL_LUA_VERSION_I_ <= 501 && SOL_IS_ON(SOL_USE_LUAJIT) case lib::coroutine: #endif // luajit opens coroutine base stuff case lib::base: @@ -140,7 +140,7 @@ namespace sol { luaL_requiref(L, "package", luaopen_package, 1); lua_pop(L, 1); break; -#if SOL_IS_OFF(SOL_USE_LUAJIT_I_) +#if SOL_IS_OFF(SOL_USE_LUAJIT) case lib::coroutine: #if SOL_LUA_VERSION_I_ > 501 luaL_requiref(L, "coroutine", luaopen_coroutine, 1); @@ -161,10 +161,10 @@ namespace sol { lua_pop(L, 1); break; case lib::bit32: -#if SOL_IS_ON(SOL_USE_LUAJIT_I_) +#if SOL_IS_ON(SOL_USE_LUAJIT) luaL_requiref(L, "bit32", luaopen_bit, 1); lua_pop(L, 1); -#elif SOL_IS_ON(SOL_LUA_BIT32_LIB_I_) +#elif SOL_IS_ON(SOL_LUA_BIT32_LIB) luaL_requiref(L, "bit32", luaopen_bit32, 1); lua_pop(L, 1); #else @@ -183,19 +183,19 @@ namespace sol { lua_pop(L, 1); break; case lib::utf8: -#if SOL_LUA_VERSION_I_ > 502 && SOL_IS_OFF(SOL_USE_LUAJIT_I_) +#if SOL_LUA_VERSION_I_ > 502 && SOL_IS_OFF(SOL_USE_LUAJIT) luaL_requiref(L, "utf8", luaopen_utf8, 1); lua_pop(L, 1); #endif // Lua 5.3+ only break; case lib::ffi: -#if SOL_IS_ON(SOL_USE_LUAJIT_I_) && SOL_IS_OFF(SOL_LUAJIT_FFI_DISABLED_I_) +#if SOL_IS_ON(SOL_USE_LUAJIT) && SOL_IS_OFF(SOL_LUAJIT_FFI_DISABLED) luaL_requiref(L, "ffi", luaopen_ffi, 1); lua_pop(L, 1); #endif // LuaJIT only break; case lib::jit: -#if SOL_IS_ON(SOL_USE_LUAJIT_I_) +#if SOL_IS_ON(SOL_USE_LUAJIT) luaL_requiref(L, "jit", luaopen_jit, 0); lua_pop(L, 1); #endif // LuaJIT Only @@ -551,7 +551,7 @@ namespace sol { return safe_script_file(filename, env, script_default_on_error, mode); } -#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_) +#if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS) protected_function_result script( lua_Reader reader, void* data, const std::string& chunkname = detail::default_chunk_name(), load_mode mode = load_mode::any) { return safe_script(reader, data, chunkname, mode); diff --git a/include/sol/table_core.hpp b/include/sol/table_core.hpp index df2ace5c..45c9d3a8 100644 --- a/include/sol/table_core.hpp +++ b/include/sol/table_core.hpp @@ -330,7 +330,7 @@ namespace sol { template >> = meta::enabler> basic_table_core(lua_State* L, T&& r) : base_t(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); constructor_handler handler {}; @@ -345,14 +345,14 @@ namespace sol { } basic_table_core(lua_State* L, int index = -1) : basic_table_core(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_table_core(lua_State* L, ref_index index) : basic_table_core(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); constructor_handler handler {}; @@ -364,7 +364,7 @@ namespace sol { meta::enable, basic_table_core>>, meta::neg>, meta::neg>>, is_lua_reference>> = meta::enabler> basic_table_core(T&& r) noexcept : basic_table_core(detail::no_safety, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_table>::value) { auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); diff --git a/include/sol/thread.hpp b/include/sol/thread.hpp index fc933d0e..46357750 100644 --- a/include/sol/thread.hpp +++ b/include/sol/thread.hpp @@ -94,7 +94,7 @@ namespace sol { template , basic_thread>>, is_lua_reference>> = meta::enabler> basic_thread(T&& r) : base_t(std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -106,20 +106,20 @@ namespace sol { basic_thread& operator=(basic_thread&&) = default; template >> = meta::enabler> basic_thread(lua_State* L, T&& r) : base_t(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); #endif // Safety } basic_thread(lua_State* L, int index = -1) : base_t(L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_thread(lua_State* L, ref_index index) : base_t(L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); @@ -130,7 +130,7 @@ namespace sol { basic_thread(lua_State* L, this_state actualthread) : basic_thread(L, lua_thread_state { actualthread.L }) { } basic_thread(lua_State* L, lua_thread_state actualthread) : base_t(L, -stack::push(L, actualthread)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(lua_state(), -1, handler); #endif // Safety diff --git a/include/sol/traits.hpp b/include/sol/traits.hpp index 5af4cb37..b95ecb96 100644 --- a/include/sol/traits.hpp +++ b/include/sol/traits.hpp @@ -37,7 +37,7 @@ #include #include #include -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // variant is weird on XCode, thanks XCode @@ -479,7 +479,7 @@ namespace sol { namespace meta { template class supports_op_less_test() < std::declval())>> : public std::integral_constant, std::variant> && !is_specialization_of_v, std::variant> #else true @@ -492,7 +492,7 @@ namespace sol { namespace meta { template class supports_op_equal_test() == std::declval())>> : public std::integral_constant, std::variant> && !is_specialization_of_v, std::variant> #else true @@ -505,7 +505,7 @@ namespace sol { namespace meta { template class supports_op_less_equal_test() <= std::declval())>> : public std::integral_constant, std::variant> && !is_specialization_of_v, std::variant> #else true @@ -627,7 +627,7 @@ namespace sol { namespace meta { template using is_string_literal_array = boolean && any_same_v, char, -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) char8_t, #endif char16_t, char32_t, wchar_t>>; diff --git a/include/sol/trampoline.hpp b/include/sol/trampoline.hpp index d4e5bfc5..d6bf90c9 100644 --- a/include/sol/trampoline.hpp +++ b/include/sol/trampoline.hpp @@ -29,7 +29,7 @@ #include #include -#if SOL_IS_ON(SOL_PRINT_ERRORS_I_) +#if SOL_IS_ON(SOL_PRINT_ERRORS) #include #endif @@ -47,7 +47,7 @@ namespace sol { // must push at least 1 object on the stack inline int default_exception_handler(lua_State* L, optional, string_view what) { -#if SOL_IS_ON(SOL_PRINT_ERRORS_I_) +#if SOL_IS_ON(SOL_PRINT_ERRORS) std::cerr << "[sol2] An exception occurred: "; std::cerr.write(what.data(), static_cast(what.size())); std::cerr << std::endl; @@ -72,13 +72,13 @@ namespace sol { return exfunc(L, std::move(maybe_ex), std::move(what)); } -#if SOL_IS_OFF(SOL_EXCEPTIONS_I_) +#if SOL_IS_OFF(SOL_EXCEPTIONS) template int static_trampoline(lua_State* L) noexcept { return f(L); } -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) template int static_trampoline_noexcept(lua_State* L) noexcept { return f(L); @@ -101,7 +101,7 @@ namespace sol { #else inline int lua_cfunction_trampoline(lua_State* L, lua_CFunction f) { -#if SOL_IS_ON(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_PROPAGATE_EXCEPTIONS) return f(L); #else try { @@ -116,7 +116,7 @@ namespace sol { catch (const std::exception& e) { call_exception_handler(L, optional(e), e.what()); } -#if SOL_IS_ON(SOL_EXCEPTIONS_CATCH_ALL_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS_CATCH_ALL) // LuaJIT cannot have the catchall when the safe propagation is on // but LuaJIT will swallow all C++ errors // if we don't at least catch std::exception ones @@ -133,7 +133,7 @@ namespace sol { return lua_cfunction_trampoline(L, f); } -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) template int static_trampoline_noexcept(lua_State* L) noexcept { return f(L); @@ -151,7 +151,7 @@ namespace sol { return f(L, std::forward(args)...); } else { -#if SOL_IS_ON(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_PROPAGATE_EXCEPTIONS) return f(L, std::forward(args)...); #else try { @@ -166,7 +166,7 @@ namespace sol { catch (const std::exception& e) { call_exception_handler(L, optional(e), e.what()); } -#if SOL_IS_ON(SOL_EXCEPTIONS_CATCH_ALL_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS_CATCH_ALL) // LuaJIT cannot have the catchall when the safe propagation is on // but LuaJIT will swallow all C++ errors // if we don't at least catch std::exception ones diff --git a/include/sol/types.hpp b/include/sol/types.hpp index 23cfbbf0..568b29a6 100644 --- a/include/sol/types.hpp +++ b/include/sol/types.hpp @@ -40,7 +40,7 @@ #include #include #include -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // variant shenanigans (thanks, Mac OSX) @@ -55,7 +55,7 @@ namespace sol { } // namespace d namespace detail { -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) typedef int (*lua_CFunction_noexcept)(lua_State* L) noexcept; #else typedef int (*lua_CFunction_noexcept)(lua_State* L); @@ -92,7 +92,7 @@ namespace sol { inline bool operator!=(lua_nil_t, lua_nil_t) { return false; } -#if SOL_IS_ON(SOL_NIL_I_) +#if SOL_IS_ON(SOL_NIL) using nil_t = lua_nil_t; inline constexpr const nil_t& nil = lua_nil; #endif @@ -658,7 +658,7 @@ namespace sol { enum class type : int { none = LUA_TNONE, lua_nil = LUA_TNIL, -#if SOL_IS_ON(SOL_NIL_I_) +#if SOL_IS_ON(SOL_NIL) nil = lua_nil, #endif // Objective C/C++ Keyword that's found in OSX SDK and OBJC -- check for all forms to protect string = LUA_TSTRING, @@ -932,7 +932,7 @@ namespace sol { template struct lua_type_of : std::integral_constant { }; -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) template struct lua_type_of : std::integral_constant { }; #endif @@ -949,7 +949,7 @@ namespace sol { template <> struct lua_type_of : std::integral_constant { }; -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) template <> struct lua_type_of : std::integral_constant { }; #endif @@ -966,7 +966,7 @@ namespace sol { template <> struct lua_type_of : std::integral_constant { }; -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) template <> struct lua_type_of : std::integral_constant { }; #endif @@ -1115,7 +1115,7 @@ namespace sol { template <> struct lua_type_of : std::integral_constant { }; -#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE_I_) +#if SOL_IS_ON(SOL_GET_FUNCTION_POINTER_UNSAFE) template struct lua_type_of : std::integral_constant ? type::function : type::userdata> { }; #else @@ -1136,7 +1136,7 @@ namespace sol { template <> struct lua_type_of : std::integral_constant { }; -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) template struct lua_type_of> : std::integral_constant { }; #endif // std::variant deployment sucks on Clang @@ -1205,7 +1205,7 @@ namespace sol { template struct is_value_semantic_for_function -#if SOL_IS_ON(SOL_FUNCTION_CALL_VALUE_SEMANTICS_I_) +#if SOL_IS_ON(SOL_FUNCTION_CALL_VALUE_SEMANTICS) : std::true_type { }; #else @@ -1360,7 +1360,7 @@ namespace sol { template struct is_automagical : std::integral_constant> || (!std::is_same_v, state> && !std::is_same_v, state_view>))> { }; diff --git a/include/sol/unsafe_function.hpp b/include/sol/unsafe_function.hpp index 28110321..9109d6ba 100644 --- a/include/sol/unsafe_function.hpp +++ b/include/sol/unsafe_function.hpp @@ -77,7 +77,7 @@ namespace sol { meta::enable, basic_function>>, meta::neg>, meta::neg>>, is_lua_reference>> = meta::enabler> basic_function(T&& r) noexcept : base_t(std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_function>::value) { auto pp = stack::push_pop(*this); constructor_handler handler {}; @@ -97,20 +97,20 @@ namespace sol { } template >> = meta::enabler> basic_function(lua_State* L, T&& r) : base_t(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); #endif // Safety } basic_function(lua_State* L, int index = -1) : base_t(L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_function(lua_State* L, ref_index index) : base_t(L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); diff --git a/include/sol/userdata.hpp b/include/sol/userdata.hpp index e878d01b..a4fedefc 100644 --- a/include/sol/userdata.hpp +++ b/include/sol/userdata.hpp @@ -41,7 +41,7 @@ namespace sol { meta::enable, basic_userdata>>, meta::neg>, is_lua_reference>> = meta::enabler> basic_userdata(T&& r) noexcept : base_t(std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_userdata>::value) { auto pp = stack::push_pop(*this); type_assert(lua_state(), -1, type::userdata); @@ -58,20 +58,20 @@ namespace sol { } template >> = meta::enabler> basic_userdata(lua_State* L, T&& r) : base_t(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(L, -1, handler); #endif // Safety } basic_userdata(lua_State* L, int index = -1) : base_t(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_userdata(lua_State* L, ref_index index) : base_t(detail::no_safety, L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(L, -1, handler); @@ -91,7 +91,7 @@ namespace sol { meta::enable, basic_lightuserdata>>, meta::neg>, is_lua_reference>> = meta::enabler> basic_lightuserdata(T&& r) noexcept : base_t(std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) if (!is_lightuserdata>::value) { auto pp = stack::push_pop(*this); type_assert(lua_state(), -1, type::lightuserdata); @@ -108,20 +108,20 @@ namespace sol { } template >> = meta::enabler> basic_lightuserdata(lua_State* L, T&& r) : basic_lightuserdata(L, std::forward(r)) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), -1, handler); #endif // Safety } basic_lightuserdata(lua_State* L, int index = -1) : base_t(L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) constructor_handler handler {}; stack::check(L, index, handler); #endif // Safety } basic_lightuserdata(lua_State* L, ref_index index) : base_t(L, index) { -#if SOL_IS_ON(SOL_SAFE_REFERENCES_I_) +#if SOL_IS_ON(SOL_SAFE_REFERENCES) auto pp = stack::push_pop(*this); constructor_handler handler {}; stack::check(lua_state(), index, handler); diff --git a/include/sol/usertype_container.hpp b/include/sol/usertype_container.hpp index 4bb99c0f..dcc4562f 100644 --- a/include/sol/usertype_container.hpp +++ b/include/sol/usertype_container.hpp @@ -525,7 +525,7 @@ namespace sol { }; static auto& get_src(lua_State* L_) { -#if SOL_IS_ON(SOL_SAFE_USERTYPE_I_) +#if SOL_IS_ON(SOL_SAFE_USERTYPE) auto p = stack::unqualified_check_get(L_, 1); if (!p) { luaL_error(L_, @@ -1404,7 +1404,7 @@ namespace sol { static auto& get_src(lua_State* L_) { auto p = stack::unqualified_check_get(L_, 1); -#if SOL_IS_ON(SOL_SAFE_USERTYPE_I_) +#if SOL_IS_ON(SOL_SAFE_USERTYPE) if (!p) { luaL_error(L_, "sol: 'self' is not of type '%s' (pass 'self' as first argument with ':' or call on proper type)", diff --git a/include/sol/usertype_core.hpp b/include/sol/usertype_core.hpp index 51a48b9c..98ed1eae 100644 --- a/include/sol/usertype_core.hpp +++ b/include/sol/usertype_core.hpp @@ -71,7 +71,7 @@ namespace sol { return s; } -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) inline auto make_string_view(const char8_t* s) { return string_view(reinterpret_cast(s)); } diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index fdfac5ff..fd4564c2 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -67,7 +67,7 @@ namespace sol { namespace u_detail { struct binding : binding_base { using uF = meta::unqualified_t; using F = meta::conditional_t -#if SOL_IS_ON(SOL_CHAR8_T_I_) +#if SOL_IS_ON(SOL_CHAR8_T) || meta::is_c_str_of_v #endif || meta::is_c_str_of_v || meta::is_c_str_of_v || meta::is_c_str_of_v, @@ -459,7 +459,7 @@ namespace sol { namespace u_detail { } (void)L_; (void)self; -#if SOL_IS_ON(SOL_USE_UNSAFE_BASE_LOOKUP_I_) +#if SOL_IS_ON(SOL_USE_UNSAFE_BASE_LOOKUP) usertype_storage_base& base_storage = get_usertype_storage(L_); base_result = self_index_call(bases(), L_, base_storage); #else diff --git a/include/sol/version.hpp b/include/sol/version.hpp index 9b091aaa..93afc9d5 100644 --- a/include/sol/version.hpp +++ b/include/sol/version.hpp @@ -34,10 +34,21 @@ #define SOL_VERSION_STRING "3.2.3" #define SOL_VERSION ((SOL_VERSION_MAJOR * 100000) + (SOL_VERSION_MINOR * 100) + (SOL_VERSION_PATCH)) -#define SOL_IS_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) != 0) -#define SOL_IS_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3) == 0) -#define SOL_IS_DEFAULT_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) > 3) -#define SOL_IS_DEFAULT_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3 OP_SYMBOL 3) < 0) +#define SOL_TOKEN_TO_STRING_POST_EXPANSION_I_(_TOKEN) #_TOKEN +#define SOL_TOKEN_TO_STRING_I_(_TOKEN) SOL_TOKEN_TO_STRING_POST_EXPANSION_I_(_TOKEN) + +#define SOL_CONCAT_TOKENS_POST_EXPANSION_I_(_LEFT, _RIGHT) _LEFT##_RIGHT +#define SOL_CONCAT_TOKENS_I_(_LEFT, _RIGHT) SOL_CONCAT_TOKENS_POST_EXPANSION_I_(_LEFT, _RIGHT) + +#define SOL_RAW_IS_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) != 0) +#define SOL_RAW_IS_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3) == 0) +#define SOL_RAW_IS_DEFAULT_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) > 3) +#define SOL_RAW_IS_DEFAULT_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3 OP_SYMBOL 3) < 0) + +#define SOL_IS_ON(OP_SYMBOL) SOL_RAW_IS_ON(OP_SYMBOL ## _I_) +#define SOL_IS_OFF(OP_SYMBOL) SOL_RAW_IS_OFF(OP_SYMBOL ## _I_) +#define SOL_IS_DEFAULT_ON(OP_SYMBOL) SOL_RAW_IS_DEFAULT_ON(OP_SYMBOL ## _I_) +#define SOL_IS_DEFAULT_OFF(OP_SYMBOL) SOL_RAW_IS_DEFAULT_OFF(OP_SYMBOL ## _I_) #define SOL_ON | #define SOL_OFF ^ @@ -68,7 +79,7 @@ #define SOL_BUILD_C_MODE_I_ SOL_DEFAULT_OFF #endif -#if SOL_IS_ON(SOL_BUILD_C_MODE_I_) +#if SOL_IS_ON(SOL_BUILD_C_MODE) #include #include #include @@ -224,9 +235,9 @@ #define SOL_DEBUG_BUILD_I_ SOL_OFF #endif #elif !defined(NDEBUG) - #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) && defined(_DEBUG) + #if SOL_IS_ON(SOL_COMPILER_VCXX) && defined(_DEBUG) #define SOL_DEBUG_BUILD_I_ SOL_ON - #elif (SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_)) && !defined(__OPTIMIZE__) + #elif (SOL_IS_ON(SOL_COMPILER_CLANG) || SOL_IS_ON(SOL_COMPILER_GCC)) && !defined(__OPTIMIZE__) #define SOL_DEBUG_BUILD_I_ SOL_ON #else #define SOL_DEBUG_BUILD_I_ SOL_OFF @@ -241,13 +252,13 @@ #else #define SOL_EXCEPTIONS_I_ SOL_ON #endif -#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#elif SOL_IS_ON(SOL_COMPILER_VCXX) #if !defined(_CPPUNWIND) #define SOL_EXCEPTIONS_I_ SOL_OFF #else #define SOL_EXCEPTIONS_I_ SOL_ON #endif -#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_) +#elif SOL_IS_ON(SOL_COMPILER_CLANG) || SOL_IS_ON(SOL_COMPILER_GCC) #if !defined(__EXCEPTIONS) #define SOL_EXCEPTIONS_I_ SOL_OFF #else @@ -264,13 +275,13 @@ #else #define SOL_RTTI_I_ SOL_ON #endif -#elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) +#elif SOL_IS_ON(SOL_COMPILER_VCXX) #if !defined(_CPPRTTI) #define SOL_RTTI_I_ SOL_OFF #else #define SOL_RTTI_I_ SOL_ON #endif -#elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_) +#elif SOL_IS_ON(SOL_COMPILER_CLANG) || SOL_IS_ON(SOL_COMPILER_GCC) #if !defined(__GXX_RTTI) #define SOL_RTTI_I_ SOL_OFF #else @@ -307,9 +318,9 @@ #define SOL_SAFE_GETTER_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_GETTER_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_OFF @@ -323,9 +334,9 @@ #define SOL_SAFE_USERTYPE_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_USERTYPE_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_OFF @@ -339,9 +350,9 @@ #define SOL_SAFE_REFERENCES_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_REFERENCES_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_OFF @@ -361,9 +372,9 @@ #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_OFF @@ -377,9 +388,9 @@ #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_OFF @@ -393,9 +404,9 @@ #define SOL_SAFE_PROXIES_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_PROXIES_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_OFF @@ -409,9 +420,9 @@ #define SOL_SAFE_NUMERICS_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_NUMERICS_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_OFF @@ -424,7 +435,7 @@ #else #define SOL_ALL_INTEGER_VALUES_FIT_I_ SOL_OFF #endif -#elif !SOL_IS_DEFAULT_OFF(SOL_SAFE_NUMERICS_I_) && SOL_IS_OFF(SOL_SAFE_NUMERICS_I_) +#elif !SOL_IS_DEFAULT_OFF(SOL_SAFE_NUMERICS) && SOL_IS_OFF(SOL_SAFE_NUMERICS) // if numerics is intentionally turned off, flip this on #define SOL_ALL_INTEGER_VALUES_FIT_I_ SOL_DEFAULT_ON #else @@ -439,9 +450,9 @@ #define SOL_SAFE_STACK_CHECK_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_STACK_CHECK_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_OFF @@ -461,11 +472,11 @@ #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON - #elif SOL_IS_ON(SOL_SAFE_NUMERICS_I_) + #elif SOL_IS_ON(SOL_SAFE_NUMERICS) #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_ON #else #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_OFF @@ -543,7 +554,7 @@ #define SOL_STD_VARIANT_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_COMPILER_CLANG_I_) && SOL_IS_ON(SOL_PLATFORM_APPLE_I_) + #if SOL_IS_ON(SOL_COMPILER_CLANG) && SOL_IS_ON(SOL_PLATFORM_APPLE) #if defined(__has_include) #if __has_include() #define SOL_STD_VARIANT_I_ SOL_DEFAULT_ON @@ -567,7 +578,7 @@ #else #if defined(__cpp_noexcept_function_type) #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON - #elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) && (defined(_MSVC_LANG) && (_MSVC_LANG < 201403L)) + #elif SOL_IS_ON(SOL_COMPILER_VCXX) && (defined(_MSVC_LANG) && (_MSVC_LANG < 201403L)) // There is a bug in the VC++ compiler?? // on /std:c++latest under x86 conditions (VS 15.5.2), // compiler errors are tossed for noexcept markings being on function types @@ -606,9 +617,9 @@ #define SOL_PRINT_ERRORS_I_ SOL_OFF #endif #else - #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_) + #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_PRINT_ERRORS_I_ SOL_ON - #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_) + #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_PRINT_ERRORS_I_ SOL_DEFAULT_ON #else #define SOL_PRINT_ERRORS_I_ SOL_OFF @@ -765,7 +776,7 @@ #else #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_OFF #endif -#elif SOL_IS_ON(SOL_COMPILER_MINGW_I_) && defined(__GNUC__) && (__GNUC__ < 6) +#elif SOL_IS_ON(SOL_COMPILER_MINGW) && defined(__GNUC__) && (__GNUC__ < 6) // MinGW is off its rocker in some places... #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_DEFAULT_ON #else @@ -786,7 +797,7 @@ #endif #endif -#if SOL_IS_ON(SOL_USE_BOOST_I_) +#if SOL_IS_ON(SOL_USE_BOOST) #include #if BOOST_VERSION >= 107500 // Since Boost 1.75.0 boost::none is constexpr diff --git a/include/sol/wrapper.hpp b/include/sol/wrapper.hpp index 608ed589..6d33e71e 100644 --- a/include/sol/wrapper.hpp +++ b/include/sol/wrapper.hpp @@ -222,7 +222,7 @@ namespace sol { template struct wrapper : public member_function_wrapper { }; -#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_) +#if SOL_IS_ON(SOL_USE_NOEXCEPT_FUNCTION_TYPE) // noexcept has become a part of a function's type template diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7f4e8b51..e25ae3ca 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -26,7 +26,7 @@ FetchContent_Declare( catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.6 + GIT_TAG devel ) FetchContent_MakeAvailable(catch2) diff --git a/tests/config_tests/function_pointers/source/main.cpp b/tests/config_tests/function_pointers/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/config_tests/function_pointers/source/main.cpp +++ b/tests/config_tests/function_pointers/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/config_tests/function_pointers/source/retrieval.cpp b/tests/config_tests/function_pointers/source/retrieval.cpp index fba09d08..8a1b6dae 100644 --- a/tests/config_tests/function_pointers/source/retrieval.cpp +++ b/tests/config_tests/function_pointers/source/retrieval.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/config_tests/integer_value_fits/source/main.cpp b/tests/config_tests/integer_value_fits/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/config_tests/integer_value_fits/source/main.cpp +++ b/tests/config_tests/integer_value_fits/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/config_tests/integer_value_fits/source/negative_size_t.cpp b/tests/config_tests/integer_value_fits/source/negative_size_t.cpp index ef571693..361074f0 100644 --- a/tests/config_tests/integer_value_fits/source/negative_size_t.cpp +++ b/tests/config_tests/integer_value_fits/source/negative_size_t.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include @@ -34,8 +34,9 @@ inline namespace sol2_tests_negative_size_t { } } // namespace sol2_tests_negative_size_t -#if SOL_LUA_VERSION_I_ >= 502 TEST_CASE("numeric/negative size_t", "handle negative integers casted to size_t values") { +#if SOL_LUA_VERSION_I_ > 502 + // For 5.3 and above, this can fit using the negative-cast method sol::state lua; lua.set_function("f", &npos_like_api); @@ -46,6 +47,16 @@ TEST_CASE("numeric/negative size_t", "handle negative integers casted to size_t REQUIRE_FALSE(maybe_error.has_value()); size_t should_be_like_npos = lua["v"]; REQUIRE(should_be_like_npos == size_t(-1)); -} +#elif SOL_LUA_VERSION_I_ <= 502 + // For 5.2 and below, this will trigger an error if checking is on + sol::state lua; + lua.set_function("f", &npos_like_api); + auto result = lua.safe_script("v = f()", sol::script_pass_on_error); + sol::optional maybe_error = result; + REQUIRE_FALSE(result.valid()); + REQUIRE(result.status() != sol::call_status::ok); + REQUIRE(result.status() == sol::call_status::runtime); + REQUIRE(maybe_error.has_value()); #endif +} diff --git a/tests/enum/source/main.cpp b/tests/enum/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/enum/source/main.cpp +++ b/tests/enum/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/enum/source/read_only_iteration.cpp b/tests/enum/source/read_only_iteration.cpp index 951b1735..cab8bb3a 100644 --- a/tests/enum/source/read_only_iteration.cpp +++ b/tests/enum/source/read_only_iteration.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/environment/source/get.cpp b/tests/environment/source/get.cpp index aeca23a8..5281c4b2 100644 --- a/tests/environment/source/get.cpp +++ b/tests/environment/source/get.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/environment/source/main.cpp b/tests/environment/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/environment/source/main.cpp +++ b/tests/environment/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/environment/source/sandboxing.cpp b/tests/environment/source/sandboxing.cpp index 49b40494..e6688efe 100644 --- a/tests/environment/source/sandboxing.cpp +++ b/tests/environment/source/sandboxing.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/environment/source/shadowing.cpp b/tests/environment/source/shadowing.cpp index 6974c3f8..8e86427a 100644 --- a/tests/environment/source/shadowing.cpp +++ b/tests/environment/source/shadowing.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/environment/source/this_environment.cpp b/tests/environment/source/this_environment.cpp index 75dc0a76..ed796a6b 100644 --- a/tests/environment/source/this_environment.cpp +++ b/tests/environment/source/this_environment.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/exceptions/source/functions.cpp b/tests/exceptions/source/functions.cpp index 686f8da0..1ee409ad 100644 --- a/tests/exceptions/source/functions.cpp +++ b/tests/exceptions/source/functions.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/exceptions/source/functions.noexcept.cpp b/tests/exceptions/source/functions.noexcept.cpp index 55dbfd68..d051596a 100644 --- a/tests/exceptions/source/functions.noexcept.cpp +++ b/tests/exceptions/source/functions.noexcept.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include @@ -92,4 +92,4 @@ TEST_CASE("exceptions/functions/noexcept", "allow noexcept functions to be seria REQUIRE(v6 == 0x62); REQUIRE(v7 == 0x63); REQUIRE(v8 == 0x63); -} \ No newline at end of file +} diff --git a/tests/exceptions/source/functions.yielding.cpp b/tests/exceptions/source/functions.yielding.cpp index bcdd5d7d..9160e3cf 100644 --- a/tests/exceptions/source/functions.yielding.cpp +++ b/tests/exceptions/source/functions.yielding.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/exceptions/source/main.cpp b/tests/exceptions/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/exceptions/source/main.cpp +++ b/tests/exceptions/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/exceptions/source/usertypes.cpp b/tests/exceptions/source/usertypes.cpp index cf19e71c..4fe4f616 100644 --- a/tests/exceptions/source/usertypes.cpp +++ b/tests/exceptions/source/usertypes.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/exceptions/source/usertypes.yielding.cpp b/tests/exceptions/source/usertypes.yielding.cpp index 4b18094d..5257c7d6 100644 --- a/tests/exceptions/source/usertypes.yielding.cpp +++ b/tests/exceptions/source/usertypes.yielding.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/numerics/source/large.cpp b/tests/numerics/source/large.cpp index b18dbc9e..cb7b1cec 100644 --- a/tests/numerics/source/large.cpp +++ b/tests/numerics/source/large.cpp @@ -21,7 +21,7 @@ // 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. -#include +#include #include diff --git a/tests/numerics/source/main.cpp b/tests/numerics/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/numerics/source/main.cpp +++ b/tests/numerics/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/regression_tests/simple/source/1000 - readonly warning.cpp b/tests/regression_tests/simple/source/1000 - readonly warning.cpp index a06f7cee..ab9f8e60 100644 --- a/tests/regression_tests/simple/source/1000 - readonly warning.cpp +++ b/tests/regression_tests/simple/source/1000 - readonly warning.cpp @@ -1,3 +1,28 @@ +// 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. + +#include + #include inline namespace sol2_regression_test_1000 { @@ -9,12 +34,10 @@ inline namespace sol2_regression_test_1000 { }; } // namespace sol2_regression_test_1000 -unsigned int regression_1000() { +TEST_CASE("Test for Issue #1000 - readonly warning", "[sol2][regression][Issue-1000]") { sol::state lua; lua.create_named_table("t"); sol::table t = lua["t"]; foo::register_into(t); - - return 0; } diff --git a/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp b/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp index e253a55b..7f63d529 100644 --- a/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp +++ b/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp @@ -1,12 +1,35 @@ -#include +// 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. -unsigned int regression_1008() { +// 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. +#include + +#include + +TEST_CASE("Test for Issue #1008 - as_function binding must trigger correctly", "[sol2][regression][Issue-1008]") { sol::state lua; lua.create_named_table("t"); sol::table t = lua["t"]; t["f"] = sol::as_function([]() {}); - - return 0; + REQUIRE(true); // should compile, run, and reach here } diff --git a/tests/regression_tests/simple/source/1067 - optional bindings.cpp b/tests/regression_tests/simple/source/1067 - optional bindings.cpp index decb350d..36be8f63 100644 --- a/tests/regression_tests/simple/source/1067 - optional bindings.cpp +++ b/tests/regression_tests/simple/source/1067 - optional bindings.cpp @@ -1,11 +1,36 @@ +// 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. + +#include + #include -unsigned int regression_1067() { +TEST_CASE("Test for Issue #1067 - as_function binding not triggering properly", "[sol2][regression][Issue-1067]") { sol::state lua; lua.open_libraries(sol::lib::base); lua["fct"] = std::function { []() { return 42; } }; sol::optional maybe_error = lua.safe_script("assert(fct() == 42)", sol::script_pass_on_error); - return maybe_error.has_value() ? 1 : 0; + REQUIRE_FALSE(maybe_error.has_value()); } diff --git a/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp b/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp index 6026b2ec..5b770931 100644 --- a/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp +++ b/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp @@ -1,13 +1,37 @@ +// 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. + +#include + #include -unsigned int regression_1072() { - auto st = sol::state {}; +TEST_CASE("Test for Issue #1072 - capture exception propagation", "[sol2][regression][Issue-1072]") { + auto lua = sol::state {}; // If you remove the capture, the problem goes away. - st["foo"] = [&] { throw std::runtime_error(""); }; - sol::protected_function_result result = st.safe_script("foo()", sol::script_pass_on_error); - if (!result.valid()) { - sol::error err = result; - return 0; - } - return 1; -} \ No newline at end of file + lua["foo"] = [&] { throw std::runtime_error(""); }; + sol::protected_function_result result = lua.safe_script("foo()", sol::script_pass_on_error); + REQUIRE_FALSE(result.valid()); + // ensure the conversion works + [[maybe_unused]] sol::error err = result; + lua["enshrine"] = (void*)&err; +} diff --git a/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp b/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp index b8801600..6b422361 100644 --- a/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp +++ b/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp @@ -1,3 +1,28 @@ +// 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. + +#include + #include inline namespace sol2_regression_test_1087 { @@ -6,22 +31,10 @@ inline namespace sol2_regression_test_1087 { }; } // namespace sol2_regression_test_1087 -unsigned int regression_1087() { +TEST_CASE("Test for Issue #1087 - readonly property error checking", "[sol2][regression][Issue-1087]") { sol::state lua; - lua.open_libraries(sol::lib::base, - sol::lib::package, - sol::lib::coroutine, - sol::lib::string, - sol::lib::os, - sol::lib::math, - sol::lib::table, - sol::lib::io, - sol::lib::debug); + lua.open_libraries(sol::lib::base); lua.new_usertype("MyStruct", "prop", sol::readonly_property(&MyStruct::prop)); sol::optional maybe_error = lua.safe_script("local s = MyStruct.new(); s.prop = 20", sol::script_pass_on_error); - if (maybe_error.has_value()) { - // good: cannot write to this property - return 0; - } - return 1; -} \ No newline at end of file + REQUIRE(maybe_error.has_value()); +} diff --git a/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp b/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp index 1d41f7c7..80b78897 100644 --- a/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp +++ b/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp @@ -1,19 +1,41 @@ +// 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. + +#include + #include #include #include -unsigned int regression_1095() { +TEST_CASE("Test for Issue #1095 - raw_get from global table should NOT fail at all", "[sol2][regression][Issue-1095]") { const std::string magic_value = "test_value"; sol::state lua; lua[magic_value] = magic_value; - if (lua.globals().get(magic_value) != magic_value) { - return 1; - } - if (lua.globals().raw_get(magic_value) != magic_value) { - return 2; - } - return 0; + std::string test0 = lua.globals().get(magic_value); + REQUIRE(test0 == magic_value); + std::string test1 = lua.globals().raw_get(magic_value); + REQUIRE(test1 == magic_value); } diff --git a/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp b/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp index 642202c4..c51daed1 100644 --- a/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp +++ b/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp @@ -1,3 +1,28 @@ +// 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. + +#include + #include #include @@ -10,7 +35,7 @@ inline namespace sol2_regression_test_1096 { } } // namespace sol2_regression_test_1096 -unsigned int regression_1096() { +TEST_CASE("Test for Issue #1096 - checking different functions/lambdas/structures bind as intendedcorrectly", "[sol2][regression][Issue-1096]") { sol::state lua; lua.open_libraries(sol::lib::base); @@ -38,5 +63,5 @@ unsigned int regression_1096() { ++accumulated_errors; } } - return accumulated_errors; + REQUIRE(accumulated_errors == 0); } diff --git a/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp b/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp index 598cd25d..1a96875a 100644 --- a/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp +++ b/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp @@ -1,3 +1,28 @@ +// 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. + +#include + #include #include @@ -15,15 +40,11 @@ inline namespace sol2_regression_test_1144 { } } // namespace sol2_regression_test_1144 -unsigned int regression_1144() { +TEST_CASE("Test for Issue #1144 -", "[sol2][regression][Issue-1144]") { sol::state state; bind_class(state); sol::protected_function_result pr = state.do_string("local a = MyClass();"); - if (!pr.valid()) { - sol::error err = pr; - std::cout << "An error occurred, as expected:\n" << err.what() << std::endl; - return 0; - } - - return 1; + REQUIRE_FALSE(pr.valid()); + sol::error err = pr; + std::cout << "An error occurred, as expected:\n" << err.what() << std::endl; } diff --git a/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp b/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp index b0c079ea..bc5f0f14 100644 --- a/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp +++ b/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp @@ -1,3 +1,28 @@ +// 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. + +#include + #include inline namespace sol2_regression_test_1149 { @@ -11,13 +36,11 @@ inline namespace sol2_regression_test_1149 { }; } // namespace sol2_regression_test_1149 -unsigned int regression_1149() { +TEST_CASE("Test for Issue #1149 - static method should not be morphed to const and error internally", "[sol2][regression][Issue-1149]") { sol::state lua = {}; auto T = lua.new_usertype("Test"); - // compile ok. + // Does compile ok. T.set_function("create", &Test::create); - // compile error. + // should NOT be a compile error, but it was. T.set_function("staticCreate", &Test::staticCreate); - - return 0; } diff --git a/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp b/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp index 9def8c17..70ed6e04 100644 --- a/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp +++ b/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp @@ -1,3 +1,28 @@ +// 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. + +#include + #include #if SOL_TESTS_SIZEOF_VOID_P == 4 @@ -12,7 +37,7 @@ inline namespace sol2_regression_test_1192 { }; } // namespace sol2_regression_test_1192 -unsigned int regression_1192() { +TEST_CASE("Test for Issue #1192 - alignment test should not fail for strangely-aligned / over-aligned objects", "[sol2][regression][Issue-1192]") { sol::state lua; static_assert(sizeof(Test) == 8); @@ -20,8 +45,8 @@ unsigned int regression_1192() { static_assert(sizeof(Test*) == 4); static_assert(alignof(Test*) == 4); - /// [sol2] An error occurred and panic has been invoked: aligned allocation of userdata block (data section) for 'sol2_regression_test_1192::Test' failed - /// Note: may not panic depending on alignment of local variable `alignment_shim` in sol::detail::aligned_space_for + /// [sol2] An error occurred and panic has been invoked: aligned allocation of userdata block (data section) for 'sol2_regression_test_1192::Test' + /// failed Note: may not panic depending on alignment of local variable `alignment_shim` in sol::detail::aligned_space_for lua["test"] = Test {}; // Test also unique and over-aligned userdata @@ -31,10 +56,4 @@ unsigned int regression_1192() { return 0; } -#else - -unsigned int regression_1192() { - return 0; -} - #endif diff --git a/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp b/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp index c75f6b66..7be076db 100644 --- a/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp +++ b/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp @@ -1,7 +1,34 @@ +// 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. + +#include + #include -unsigned int regression_1211() { - sol::protected_function_result let_die; - (void)let_die; - return 0; +TEST_CASE("Test for Issue #1211 - default-constructed protected_function_result should destruct fine", "[sol2][regression][Issue-1211]") { + { + // Should destruct properly, without issue. + [[maybe_unused]] sol::protected_function_result let_die; + } + REQUIRE(true); // should reach here just fine. } diff --git a/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp b/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp new file mode 100644 index 00000000..24240e16 --- /dev/null +++ b/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp @@ -0,0 +1,141 @@ +// 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. + +#include + +#include + +inline namespace sol2_regression_test_1315 { + struct A { + public: + A() { + } + + std::vector children; + }; + + static std::vector* getChildrenPtr(A& a) { + return &a.children; + } + + static std::vector& getChildrenRef(A& a) { + return a.children; + } + + static std::vector getChildrenValue(A& a) { + return a.children; + } + + constexpr const auto& code = R"( +for i=1, 100 do +co = coroutine.create( function() + for child_index, child in ipairs(A.children) do + collectgarbage() + assert(child == child_index) + end + collectgarbage() +end) +coroutine.resume(co) +end)"; + +} // namespace sol2_regression_test_1315 + + +TEST_CASE("Test for Issue #1315 - memory keep-alive with iteration functions, using a pointer", "[sol2][regression][Issue-1315][pointer]") { + sol::state lua; + lua.open_libraries(sol::lib::base, sol::lib::coroutine); + + A a {}; + for (int i = 0; i < 100; i++) { + a.children.push_back(i); + } + + auto perform_action = [&lua]() { + // call lua code directly + auto result = lua.safe_script(code, sol::script_pass_on_error); + sol::optional maybe_err = result.get>(); + REQUIRE(result.status() == sol::call_status::ok); + REQUIRE_FALSE(maybe_err.has_value()); + }; + + SECTION("A as a pointer") { + lua["A"] = &a; + SECTION("using getChildrenPtr as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenPtr)); + perform_action(); + } + SECTION("using getChildrenRef as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenRef)); + perform_action(); + } + SECTION("using getChildrenValue as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenValue)); + perform_action(); + } + } + SECTION("A as a std::ref") { + lua["A"] = std::ref(a); + SECTION("using getChildrenPtr as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenPtr)); + perform_action(); + } + SECTION("using getChildrenRef as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenRef)); + perform_action(); + } + SECTION("using getChildrenValue as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenValue)); + perform_action(); + } + } + SECTION("A usertype object as a value (copied)") { + lua["A"] = a; + SECTION("using getChildrenPtr as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenPtr)); + perform_action(); + } + SECTION("using getChildrenRef as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenRef)); + perform_action(); + } + SECTION("using getChildrenValue as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenValue)); + perform_action(); + } + } + SECTION("A usertype object as a value (moved)") { + lua["A"] = std::move(a); + SECTION("using getChildrenPtr as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenPtr)); + perform_action(); + } + SECTION("using getChildrenRef as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenRef)); + perform_action(); + } + SECTION("using getChildrenValue as the sol::property function") { + lua.new_usertype("A", "children", sol::property(getChildrenValue)); + perform_action(); + } + } +} diff --git a/tests/regression_tests/simple/source/main.cpp b/tests/regression_tests/simple/source/main.cpp index 7a709632..bdceb49b 100644 --- a/tests/regression_tests/simple/source/main.cpp +++ b/tests/regression_tests/simple/source/main.cpp @@ -1,44 +1,31 @@ -#include - -using f_ptr = unsigned int(); - -extern unsigned int regression_1000(); -extern unsigned int regression_1008(); -extern unsigned int regression_1067(); -extern unsigned int regression_1072(); -extern unsigned int regression_1087(); -extern unsigned int regression_1095(); -extern unsigned int regression_1096(); -extern unsigned int regression_1149(); -extern unsigned int regression_1192(); -extern unsigned int regression_1211(); - -static f_ptr* const regression_tests_regressions[] = { ®ression_1008, - ®ression_1000, - ®ression_1067, - ®ression_1072, - ®ression_1087, - ®ression_1095, - ®ression_1096, - ®ression_1149, - ®ression_1192, - ®ression_1211 }; -static const int regression_tests_sizeof_regressions = sizeof(regression_tests_regressions) / sizeof(regression_tests_regressions[0]); - -int trampoline(f_ptr* f) { - try { - return f(); - } - catch (...) { - } - return 1; -} +// 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. + +#define CATCH_CONFIG_RUNNER + +#include -int main(int, char*[]) { - int r = 0; - for (std::size_t i = 0; i < regression_tests_sizeof_regressions; ++i) { - f_ptr* f = regression_tests_regressions[i]; - r += static_cast(trampoline(f) != 0u); - } - return r; +int main(int argc, char* argv[]) { + int result = Catch::Session().run(argc, argv); + return result; } diff --git a/tests/run_time/source/basic.cpp b/tests/run_time/source/basic.cpp index eb8c1a3b..5a8d013b 100644 --- a/tests/run_time/source/basic.cpp +++ b/tests/run_time/source/basic.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/container.usertype_check.cpp b/tests/run_time/source/container.usertype_check.cpp index cc65a414..751b0626 100644 --- a/tests/run_time/source/container.usertype_check.cpp +++ b/tests/run_time/source/container.usertype_check.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include struct user_container_type : public std::vector { diff --git a/tests/run_time/source/container_semantics.cpp b/tests/run_time/source/container_semantics.cpp index 83444a03..6d45904d 100644 --- a/tests/run_time/source/container_semantics.cpp +++ b/tests/run_time/source/container_semantics.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include @@ -88,11 +88,11 @@ end REQUIRE(r.valid()); } { - auto r = lua.safe_script("c[#c + 1] = 18", sol::script_pass_on_error); + auto r = lua.safe_script("c[Issue-c + 1] = 18", sol::script_pass_on_error); REQUIRE(r.valid()); } { - auto r = lua.safe_script("v3 = c[#c]", sol::script_pass_on_error); + auto r = lua.safe_script("v3 = c[Issue-c]", sol::script_pass_on_error); REQUIRE(r.valid()); } auto backit = items.begin(); diff --git a/tests/run_time/source/container_semantics.custom.cpp b/tests/run_time/source/container_semantics.custom.cpp index a55ddf9d..4f01985e 100644 --- a/tests/run_time/source/container_semantics.custom.cpp +++ b/tests/run_time/source/container_semantics.custom.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/container_semantics.ordered.cpp b/tests/run_time/source/container_semantics.ordered.cpp index ffd4bfeb..04a0664d 100644 --- a/tests/run_time/source/container_semantics.ordered.cpp +++ b/tests/run_time/source/container_semantics.ordered.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/container_semantics.unordered.cpp b/tests/run_time/source/container_semantics.unordered.cpp index b5ca750c..4c5d328b 100644 --- a/tests/run_time/source/container_semantics.unordered.cpp +++ b/tests/run_time/source/container_semantics.unordered.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/container_shims.cpp b/tests/run_time/source/container_shims.cpp index 9377a685..e0a37202 100644 --- a/tests/run_time/source/container_shims.cpp +++ b/tests/run_time/source/container_shims.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/container_table.cpp b/tests/run_time/source/container_table.cpp index 04841ca5..7d53f25b 100644 --- a/tests/run_time/source/container_table.cpp +++ b/tests/run_time/source/container_table.cpp @@ -24,7 +24,7 @@ #include "sol_test.hpp" #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/containers.cpp b/tests/run_time/source/containers.cpp index 4d9a243a..5692f196 100644 --- a/tests/run_time/source/containers.cpp +++ b/tests/run_time/source/containers.cpp @@ -24,7 +24,7 @@ #include "sol_test.hpp" #include "common_classes.hpp" -#include +#include #include #include @@ -387,8 +387,8 @@ function f_fill(vec) end function f_append(vec) print("#vec in lua: " .. #vec) - vec[#vec] = -10456407 - vec[#vec + 1] = -54 + vec[Issue-vec] = -10456407 + vec[Issue-vec + 1] = -54 print("#vec in lua: " .. #vec) end )", diff --git a/tests/run_time/source/containers.roundtrip.cpp b/tests/run_time/source/containers.roundtrip.cpp index fcb67653..224f51cb 100644 --- a/tests/run_time/source/containers.roundtrip.cpp +++ b/tests/run_time/source/containers.roundtrip.cpp @@ -24,7 +24,7 @@ #include "sol_test.hpp" #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/containers.table.cpp b/tests/run_time/source/containers.table.cpp index 7e7350f6..b5d3e6a6 100644 --- a/tests/run_time/source/containers.table.cpp +++ b/tests/run_time/source/containers.table.cpp @@ -24,7 +24,7 @@ #include "sol_test.hpp" #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/coroutines.cpp b/tests/run_time/source/coroutines.cpp index d5a718ad..f1501f22 100644 --- a/tests/run_time/source/coroutines.cpp +++ b/tests/run_time/source/coroutines.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include diff --git a/tests/run_time/source/customizations.cpp b/tests/run_time/source/customizations.cpp index 0c63fa1a..fb16afaf 100644 --- a/tests/run_time/source/customizations.cpp +++ b/tests/run_time/source/customizations.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/customizations_private.cpp b/tests/run_time/source/customizations_private.cpp index d97d9bef..9f0492b7 100644 --- a/tests/run_time/source/customizations_private.cpp +++ b/tests/run_time/source/customizations_private.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/dump.cpp b/tests/run_time/source/dump.cpp index 649ed365..b6453a7d 100644 --- a/tests/run_time/source/dump.cpp +++ b/tests/run_time/source/dump.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/functions.cpp b/tests/run_time/source/functions.cpp index 368e37f1..2a0b561a 100644 --- a/tests/run_time/source/functions.cpp +++ b/tests/run_time/source/functions.cpp @@ -24,7 +24,7 @@ #include "sol_test.hpp" -#include +#include #include @@ -447,8 +447,8 @@ TEST_CASE("functions/unsafe protected_function_result handlers", present = (bool)opvalue; REQUIRE_FALSE(present); sol::error err = result; -#if SOL_IS_ON(SOL_USE_LUAJIT_I_) -#if SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_USE_LUAJIT) +#if SOL_IS_OFF(SOL_PROPAGATE_EXCEPTIONS) REQUIRE(err.what() == std::string("C++ exception")); #else REQUIRE(err.what() == handlederrormessage_s); diff --git a/tests/run_time/source/functions.std.cpp b/tests/run_time/source/functions.std.cpp index 12f58279..1b69d647 100644 --- a/tests/run_time/source/functions.std.cpp +++ b/tests/run_time/source/functions.std.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include diff --git a/tests/run_time/source/gc.cpp b/tests/run_time/source/gc.cpp index 3e87f113..73c37529 100644 --- a/tests/run_time/source/gc.cpp +++ b/tests/run_time/source/gc.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/lua_value.cpp b/tests/run_time/source/lua_value.cpp index 428e15d3..efde532b 100644 --- a/tests/run_time/source/lua_value.cpp +++ b/tests/run_time/source/lua_value.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include @@ -71,7 +71,7 @@ void lua_value_construct_race() { } TEST_CASE("lua_value/nested", "make nested values can be put in lua_value properly") { -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) using mixed_table_entry = std::variant; using nested_entry = std::variant>; @@ -144,7 +144,7 @@ TEST_CASE("lua_value/nested", "make nested values can be put in lua_value proper } TEST_CASE("lua_value/nested key value", "make nested values (key value) can be put in lua_value properly") { -#if SOL_IS_ON(SOL_STD_VARIANT_I_) +#if SOL_IS_ON(SOL_STD_VARIANT) using mixed_table_entry = std::variant; using nested_entry = std::variant>; diff --git a/tests/run_time/source/main.cpp b/tests/run_time/source/main.cpp index c1cd70f0..839327e9 100644 --- a/tests/run_time/source/main.cpp +++ b/tests/run_time/source/main.cpp @@ -22,7 +22,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define CATCH_CONFIG_RUNNER -#include +#include int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); diff --git a/tests/run_time/source/operators.cpp b/tests/run_time/source/operators.cpp index 7fac1bde..b4e78e0b 100644 --- a/tests/run_time/source/operators.cpp +++ b/tests/run_time/source/operators.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/overflow.cpp b/tests/run_time/source/overflow.cpp index ca63a891..32cff138 100644 --- a/tests/run_time/source/overflow.cpp +++ b/tests/run_time/source/overflow.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include TEST_CASE("issues/stack overflow", "make sure various operations repeated don't trigger stack overflow") { sol::state lua; diff --git a/tests/run_time/source/plain_types.cpp b/tests/run_time/source/plain_types.cpp index 5d0cf3d7..cb3f6f0b 100644 --- a/tests/run_time/source/plain_types.cpp +++ b/tests/run_time/source/plain_types.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" #include -#include +#include TEST_CASE("plain/alignment", "test that aligned classes in certain compilers don't trigger compiler errors") { diff --git a/tests/run_time/source/policies.cpp b/tests/run_time/source/policies.cpp index e8fb4d8e..d6d7cfd2 100644 --- a/tests/run_time/source/policies.cpp +++ b/tests/run_time/source/policies.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/proxies.cpp b/tests/run_time/source/proxies.cpp index 2c478011..564a47f2 100644 --- a/tests/run_time/source/proxies.cpp +++ b/tests/run_time/source/proxies.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include diff --git a/tests/run_time/source/state.cpp b/tests/run_time/source/state.cpp index 833cb2fe..2e15620b 100644 --- a/tests/run_time/source/state.cpp +++ b/tests/run_time/source/state.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/storage.cpp b/tests/run_time/source/storage.cpp index 39dd1eb2..c382ba59 100644 --- a/tests/run_time/source/storage.cpp +++ b/tests/run_time/source/storage.cpp @@ -26,7 +26,7 @@ #include -#include +#include TEST_CASE("storage/registry construction", "ensure entries from the registry can be retrieved") { const auto& code = R"( diff --git a/tests/run_time/source/strings.cpp b/tests/run_time/source/strings.cpp index 9857ceab..1fe055af 100644 --- a/tests/run_time/source/strings.cpp +++ b/tests/run_time/source/strings.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include diff --git a/tests/run_time/source/tables.checks.cpp b/tests/run_time/source/tables.checks.cpp index 7dcf5bc8..7dbbe80a 100644 --- a/tests/run_time/source/tables.checks.cpp +++ b/tests/run_time/source/tables.checks.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include struct not_a_table_at_all { }; diff --git a/tests/run_time/source/tables.clear.cpp b/tests/run_time/source/tables.clear.cpp index 7f9677bc..dc1071b2 100644 --- a/tests/run_time/source/tables.clear.cpp +++ b/tests/run_time/source/tables.clear.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include TEST_CASE("tables/clear", "clear method works and does not clobber stack") { sol::state lua; diff --git a/tests/run_time/source/tables.cpp b/tests/run_time/source/tables.cpp index 33fb3e50..a45ec3f9 100644 --- a/tests/run_time/source/tables.cpp +++ b/tests/run_time/source/tables.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/tables.enums.cpp b/tests/run_time/source/tables.enums.cpp index 229eba08..19421d9c 100644 --- a/tests/run_time/source/tables.enums.cpp +++ b/tests/run_time/source/tables.enums.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include enum weak_direction { up, down, left, right }; enum class strong_direction { up, down, left, right }; diff --git a/tests/run_time/source/tables.indexing.cpp b/tests/run_time/source/tables.indexing.cpp index 18015349..dfb106e5 100644 --- a/tests/run_time/source/tables.indexing.cpp +++ b/tests/run_time/source/tables.indexing.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include int plop_xyz(int x, int y, std::string z) { INFO(x << " " << y << " " << z); diff --git a/tests/run_time/source/tables.insertion.cpp b/tests/run_time/source/tables.insertion.cpp index a0a4acff..38557d50 100644 --- a/tests/run_time/source/tables.insertion.cpp +++ b/tests/run_time/source/tables.insertion.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include diff --git a/tests/run_time/source/tables.traversal.cpp b/tests/run_time/source/tables.traversal.cpp index 9b9b2fc6..fffd022f 100644 --- a/tests/run_time/source/tables.traversal.cpp +++ b/tests/run_time/source/tables.traversal.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include inline namespace sol2_tables_test { inline int my_custom_next(lua_State* L_) noexcept { diff --git a/tests/run_time/source/usertypes.auxiliary_keys.cpp b/tests/run_time/source/usertypes.auxiliary_keys.cpp index 26606b2a..94404cf2 100644 --- a/tests/run_time/source/usertypes.auxiliary_keys.cpp +++ b/tests/run_time/source/usertypes.auxiliary_keys.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/usertypes.basic.cpp b/tests/run_time/source/usertypes.basic.cpp index d8720ae3..13e31547 100644 --- a/tests/run_time/source/usertypes.basic.cpp +++ b/tests/run_time/source/usertypes.basic.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include TEST_CASE("usertype/usertype", "Show that we can create classes from usertype and use them") { diff --git a/tests/run_time/source/usertypes.constructors.cpp b/tests/run_time/source/usertypes.constructors.cpp index bdb03c3b..72f9e492 100644 --- a/tests/run_time/source/usertypes.constructors.cpp +++ b/tests/run_time/source/usertypes.constructors.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include inline namespace sol2_test_usertypes_constructors { diff --git a/tests/run_time/source/usertypes.cpp b/tests/run_time/source/usertypes.cpp index 4ea7bc7b..f1c12197 100644 --- a/tests/run_time/source/usertypes.cpp +++ b/tests/run_time/source/usertypes.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/usertypes.inheritance.cpp b/tests/run_time/source/usertypes.inheritance.cpp index 8bfd6b68..d70417c1 100644 --- a/tests/run_time/source/usertypes.inheritance.cpp +++ b/tests/run_time/source/usertypes.inheritance.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include #include diff --git a/tests/run_time/source/usertypes.inheritance.multi.cpp b/tests/run_time/source/usertypes.inheritance.multi.cpp index f2eb3458..b50b30ed 100644 --- a/tests/run_time/source/usertypes.inheritance.multi.cpp +++ b/tests/run_time/source/usertypes.inheritance.multi.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include #include diff --git a/tests/run_time/source/usertypes.member_variables.cpp b/tests/run_time/source/usertypes.member_variables.cpp index 7838817b..041aece3 100644 --- a/tests/run_time/source/usertypes.member_variables.cpp +++ b/tests/run_time/source/usertypes.member_variables.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include TEST_CASE("usertype/member-variables", "allow table-like accessors to behave as member variables for usertype") { diff --git a/tests/run_time/source/usertypes.overload.cpp b/tests/run_time/source/usertypes.overload.cpp index 72c094c5..1aaba43a 100644 --- a/tests/run_time/source/usertypes.overload.cpp +++ b/tests/run_time/source/usertypes.overload.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include inline namespace sol2_test_usertypes_overload { diff --git a/tests/run_time/source/usertypes.properties.cpp b/tests/run_time/source/usertypes.properties.cpp index 31d4ec64..d7e274e9 100644 --- a/tests/run_time/source/usertypes.properties.cpp +++ b/tests/run_time/source/usertypes.properties.cpp @@ -31,7 +31,7 @@ #include "common_classes.hpp" -#include +#include bool something_func_true() { return true; diff --git a/tests/run_time/source/usertypes.runtime.cpp b/tests/run_time/source/usertypes.runtime.cpp index 761a7bee..4bc55d09 100644 --- a/tests/run_time/source/usertypes.runtime.cpp +++ b/tests/run_time/source/usertypes.runtime.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/usertypes.unique.cpp b/tests/run_time/source/usertypes.unique.cpp index 51100a51..ca3d4464 100644 --- a/tests/run_time/source/usertypes.unique.cpp +++ b/tests/run_time/source/usertypes.unique.cpp @@ -25,7 +25,7 @@ #include "common_classes.hpp" -#include +#include inline namespace sol2_test_usertype_unique { template > diff --git a/tests/run_time/source/usertypes.unregister.cpp b/tests/run_time/source/usertypes.unregister.cpp index 85d82ec1..9dc814e6 100644 --- a/tests/run_time/source/usertypes.unregister.cpp +++ b/tests/run_time/source/usertypes.unregister.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include inline namespace sol2_tests_usertypes_unregister { struct unregister_me { diff --git a/tests/run_time/source/utility.cpp b/tests/run_time/source/utility.cpp index ee225f12..41ba4545 100644 --- a/tests/run_time/source/utility.cpp +++ b/tests/run_time/source/utility.cpp @@ -24,7 +24,7 @@ #include "sol_test.hpp" #include "common_classes.hpp" -#include +#include #include #include diff --git a/tests/run_time/source/variadics.cpp b/tests/run_time/source/variadics.cpp index 0e9e56fe..b755839e 100644 --- a/tests/run_time/source/variadics.cpp +++ b/tests/run_time/source/variadics.cpp @@ -23,7 +23,7 @@ #include "sol_test.hpp" -#include +#include #include #include From 7859f53e81358ef996276603b48d44980d4c23ea Mon Sep 17 00:00:00 2001 From: Shepherd Date: Wed, 22 Jun 2022 16:53:00 -0400 Subject: [PATCH 06/53] =?UTF-8?q?=F0=9F=9B=A0=20Fix=20many=20missing=20=20includes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/sol/pointer_like.hpp | 1 + include/sol/types.hpp | 1 + include/sol/usertype_storage.hpp | 1 + tests/run_time/source/customizations.cpp | 1 + tests/run_time/source/usertypes.basic.cpp | 2 ++ tests/run_time/source/usertypes.member_variables.cpp | 2 ++ 6 files changed, 8 insertions(+) diff --git a/include/sol/pointer_like.hpp b/include/sol/pointer_like.hpp index 80bf58cb..0a3884c6 100644 --- a/include/sol/pointer_like.hpp +++ b/include/sol/pointer_like.hpp @@ -28,6 +28,7 @@ #include #include +#include namespace sol { diff --git a/include/sol/types.hpp b/include/sol/types.hpp index 568b29a6..e6cc143c 100644 --- a/include/sol/types.hpp +++ b/include/sol/types.hpp @@ -40,6 +40,7 @@ #include #include #include +#include #if SOL_IS_ON(SOL_STD_VARIANT) #include #endif // variant shenanigans (thanks, Mac OSX) diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index fd4564c2..22c2add0 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -29,6 +29,7 @@ #include #include +#include namespace sol { namespace u_detail { diff --git a/tests/run_time/source/customizations.cpp b/tests/run_time/source/customizations.cpp index fb16afaf..61e5c238 100644 --- a/tests/run_time/source/customizations.cpp +++ b/tests/run_time/source/customizations.cpp @@ -25,6 +25,7 @@ #include +#include #include #include diff --git a/tests/run_time/source/usertypes.basic.cpp b/tests/run_time/source/usertypes.basic.cpp index 13e31547..a03c1c2b 100644 --- a/tests/run_time/source/usertypes.basic.cpp +++ b/tests/run_time/source/usertypes.basic.cpp @@ -27,6 +27,8 @@ #include +#include + TEST_CASE("usertype/usertype", "Show that we can create classes from usertype and use them") { sol::state lua; diff --git a/tests/run_time/source/usertypes.member_variables.cpp b/tests/run_time/source/usertypes.member_variables.cpp index 041aece3..2d5a4621 100644 --- a/tests/run_time/source/usertypes.member_variables.cpp +++ b/tests/run_time/source/usertypes.member_variables.cpp @@ -27,6 +27,8 @@ #include +#include + TEST_CASE("usertype/member-variables", "allow table-like accessors to behave as member variables for usertype") { sol::state lua; From 268b58964c3bc1d6e6ee35b236d9af49896098de Mon Sep 17 00:00:00 2001 From: Shepherd Date: Wed, 22 Jun 2022 22:38:14 -0400 Subject: [PATCH 07/53] =?UTF-8?q?=F0=9F=9B=A0=20Avoid=20shadowing=20warnin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simple/source/1315 - keep-alive memory.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp b/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp index 24240e16..37562860 100644 --- a/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp +++ b/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp @@ -46,7 +46,14 @@ inline namespace sol2_regression_test_1315 { return a.children; } - constexpr const auto& code = R"( +} // namespace sol2_regression_test_1315 + + +TEST_CASE("Test for Issue #1315 - memory keep-alive with iteration functions, using a pointer", "[sol2][regression][Issue-1315][pointer]") { + sol::state lua; + lua.open_libraries(sol::lib::base, sol::lib::coroutine); + + constexpr const auto& coroutine_iteration_code = R"( for i=1, 100 do co = coroutine.create( function() for child_index, child in ipairs(A.children) do @@ -58,13 +65,6 @@ end) coroutine.resume(co) end)"; -} // namespace sol2_regression_test_1315 - - -TEST_CASE("Test for Issue #1315 - memory keep-alive with iteration functions, using a pointer", "[sol2][regression][Issue-1315][pointer]") { - sol::state lua; - lua.open_libraries(sol::lib::base, sol::lib::coroutine); - A a {}; for (int i = 0; i < 100; i++) { a.children.push_back(i); @@ -72,7 +72,7 @@ TEST_CASE("Test for Issue #1315 - memory keep-alive with iteration functions, us auto perform_action = [&lua]() { // call lua code directly - auto result = lua.safe_script(code, sol::script_pass_on_error); + auto result = lua.safe_script(coroutine_iteration_code, sol::script_pass_on_error); sol::optional maybe_err = result.get>(); REQUIRE(result.status() == sol::call_status::ok); REQUIRE_FALSE(maybe_err.has_value()); From 612b469ad9e8d5061826448d189116ea9626eca1 Mon Sep 17 00:00:00 2001 From: Shepherd Date: Thu, 23 Jun 2022 21:43:37 -0400 Subject: [PATCH 08/53] =?UTF-8?q?=F0=9F=9B=A0=20Retrieve=20main=20thread?= =?UTF-8?q?=20to=20prevent=20collapses=20on=20Luas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — Lua 5.1, 5.2, and 5.3 seemed to have a deficiency in which the stack thread space variable (given as a lua_State*) would die before everything referencing it would be properly dead. This made holding a reference for keep-alive purposes impossible to maintain. Therefore, we retrieve the main thread to keep it alive. --- CMakeLists.txt | 2 +- Dockerfile | 2 +- cmake/Packages/FindLuaBuild.cmake | 2 +- cmake/Packages/FindLuaBuild/LuaVanilla.cmake | 96 +------------------- include/sol/stack_check_get_qualified.hpp | 8 +- include/sol/stack_guard.hpp | 2 +- include/sol/usertype_container.hpp | 7 +- scripts/run.linux.sh | 2 +- 8 files changed, 15 insertions(+), 106 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0cea8b8..8608e19b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ include(FetchContent) # # # Configuration # # Cached defines, strings, paths and options -set(SOL2_LUA_VERSION "5.3.5" CACHE STRING "The version of Lua needed. Can be 5.1, 5.2, 5.3, 5.4, LuaJIT, or a more specific 3-part version number for a specifc Lua (e.g., 5.3.5 or luajit-2.0.5)") +set(SOL2_LUA_VERSION "5.4.4" CACHE STRING "The version of Lua needed. Can be 5.1, 5.2, 5.3, 5.4, LuaJIT, or a more specific 3-part version number for a specifc Lua (e.g., 5.4.4 or luajit-2.0.5)") set(SOL2_BUILD_LUA TRUE CACHE BOOL "Always build Lua, do not search for it in the system") set(SOL2_PLATFORM "x64" CACHE STRING "Target platform to compile for when building binaries (x86, x64)") option(SOL2_CI "Whether or not we are in continguous integration mode" OFF) diff --git a/Dockerfile b/Dockerfile index 1d9925d3..ef91b51d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ VOLUME /root/sol2 # Command line arguments, with default values ARG SOL2_PLATFORM=x64 ARG SOL2_LUA_VERSION=x64 -ARG SOL2_LUA_VERSION=5.3.5 +ARG SOL2_LUA_VERSION=5.4.4 ARG SOL2_TEST_SINGLE=false ARG SOL2_TEST_INTEROP=false ARG SOL2_CI=true diff --git a/cmake/Packages/FindLuaBuild.cmake b/cmake/Packages/FindLuaBuild.cmake index 42341271..f59dad22 100644 --- a/cmake/Packages/FindLuaBuild.cmake +++ b/cmake/Packages/FindLuaBuild.cmake @@ -107,7 +107,7 @@ if (LuaBuild_FIND_VERSION) endif() endif() if (NOT LUA_VERSION) - set(LUA_VERSION 5.3.5) + set(LUA_VERSION 5.4.4) endif() find_lua_build(${LUA_VERSION}) unset(find_lua_build) diff --git a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake index a4186841..f934b312 100644 --- a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake +++ b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake @@ -34,83 +34,8 @@ include(Common/Core) # Latest versions for specific sub-versions of Lua set(LUA_VANILLA_5.1_LATEST_VERSION 5.1.5) set(LUA_VANILLA_5.2_LATEST_VERSION 5.2.4) -set(LUA_VANILLA_5.3_LATEST_VERSION 5.3.5) -set(LUA_VANILLA_5.4_LATEST_VERSION 5.4.1) - -# exact version, coming from CI: pull directly from Lua and use external project to build -# list of known md5 / sha1: must update when there are changes -set(LUA_VANILLA_MD5_5.4.1 1d575faef1c907292edd79e7a2784d30) -set(LUA_VANILLA_SHA1_5.4.1 88961e7d4fda58ca2c6163938fd48db8880e803d) -set(LUA_VANILLA_MD5_5.4.0 dbf155764e5d433fc55ae80ea7060b60) -set(LUA_VANILLA_SHA1_5.4.0 8cdbffa8a214a23d190d7c45f38c19518ae62e89) -set(LUA_VANILLA_MD5_5.3.5 4f4b4f323fd3514a68e0ab3da8ce3455) -set(LUA_VANILLA_SHA1_5.3.5 112eb10ff04d1b4c9898e121d6bdf54a81482447) -set(LUA_VANILLA_MD5_5.3.4 53a9c68bcc0eda58bdc2095ad5cdfc63) -set(LUA_VANILLA_SHA1_5.3.4 79790cfd40e09ba796b01a571d4d63b52b1cd950) -set(LUA_VANILLA_MD5_5.3.3 703f75caa4fdf4a911c1a72e67a27498) -set(LUA_VANILLA_SHA1_5.3.3 a0341bc3d1415b814cc738b2ec01ae56045d64ef) -set(LUA_VANILLA_MD5_5.3.2 33278c2ab5ee3c1a875be8d55c1ca2a1) -set(LUA_VANILLA_SHA1_5.3.2 7a47adef554fdca7d0c5536148de34579134a973) -set(LUA_VANILLA_MD5_5.3.1 797adacada8d85761c079390ff1d9961) -set(LUA_VANILLA_SHA1_5.3.1 1676c6a041d90b6982db8cef1e5fb26000ab6dee) -set(LUA_VANILLA_MD5_5.3.0 a1b0a7e92d0c85bbff7a8d27bf29f8af) -set(LUA_VANILLA_SHA1_5.3.0 1c46d1c78c44039939e820126b86a6ae12dadfba) -set(LUA_VANILLA_MD5_5.2.4 913fdb32207046b273fdb17aad70be13) -set(LUA_VANILLA_SHA1_5.2.4 ef15259421197e3d85b7d6e4871b8c26fd82c1cf) -set(LUA_VANILLA_MD5_5.2.3 dc7f94ec6ff15c985d2d6ad0f1b35654) -set(LUA_VANILLA_SHA1_5.2.3 926b7907bc8d274e063d42804666b40a3f3c124c) -set(LUA_VANILLA_MD5_5.2.2 efbb645e897eae37cad4344ce8b0a614) -set(LUA_VANILLA_SHA1_5.2.2 0857e41e5579726a4cb96732e80d7aa47165eaf5) -set(LUA_VANILLA_MD5_5.2.1 ae08f641b45d737d12d30291a5e5f6e3) -set(LUA_VANILLA_SHA1_5.2.1 6bb1b0a39b6a5484b71a83323c690154f86b2021) -set(LUA_VANILLA_MD5_5.2.0 f1ea831f397214bae8a265995ab1a93e) -set(LUA_VANILLA_SHA1_5.2.0 08f84c355cdd646f617f09cebea48bd832415829) -set(LUA_VANILLA_MD5_5.1.5 2e115fe26e435e33b0d5c022e4490567) -set(LUA_VANILLA_SHA1_5.1.5 b3882111ad02ecc6b972f8c1241647905cb2e3fc) -set(LUA_VANILLA_MD5_5.1.4 d0870f2de55d59c1c8419f36e8fac150) -set(LUA_VANILLA_SHA1_5.1.4 2b11c8e60306efb7f0734b747588f57995493db7) -set(LUA_VANILLA_MD5_5.1.3 a70a8dfaa150e047866dc01a46272599) -set(LUA_VANILLA_SHA1_5.1.3 89bc9f5a351402565b8077e8123327e7cd15f004) -set(LUA_VANILLA_MD5_5.1.2 687ce4c2a1ddff18f1008490fdc4e5e0) -set(LUA_VANILLA_SHA1_5.1.2 8a460d2d7e70e93cb72bf3d584405464763cb5f0) -set(LUA_VANILLA_MD5_5.1.1 22f4f912f20802c11006fe9b84d5c461) -set(LUA_VANILLA_SHA1_5.1.1 be13878ceef8e1ee7a4201261f0adf09f89f1005) -set(LUA_VANILLA_MD5_5.1 3e8dfe8be00a744cec2f9e766b2f2aee) -set(LUA_VANILLA_SHA1_5.1 1ae9ec317511d525c7999c842ca0b1ddde84e374) -set(LUA_VANILLA_MD5_5.0.3 feee27132056de2949ce499b0ef4c480) -set(LUA_VANILLA_SHA1_5.0.3 e7e91f78b8a8deb09b13436829bed557a46af8ae) -set(LUA_VANILLA_MD5_5.0.2 dea74646b7e5c621fef7174df83c34b1) -set(LUA_VANILLA_SHA1_5.0.2 a200cfd20a9a4c7da1206ae45dddf26186a9e0e7) -set(LUA_VANILLA_MD5_5.0.1 e0a450d84971a3f4563b98172d1e382c) -set(LUA_VANILLA_SHA1_5.0.1 03b47b4785178aca583333f01d8726a8ab9f7ae7) -set(LUA_VANILLA_MD5_5.0 6f14803fad389fb1cb15d17edfeddd91) -set(LUA_VANILLA_SHA1_5.0 88b1bc057857c0db5ace491c4af2c917a2b803bf) -set(LUA_VANILLA_MD5_4.0.1 a31d963dbdf727f9b34eee1e0d29132c) -set(LUA_VANILLA_SHA1_4.0.1 12f1864a7ecd4b8011862a07fa3f177b2e80e7d3) -set(LUA_VANILLA_MD5_4.0 be11522d46d33a931868c03694aaeeef) -set(LUA_VANILLA_SHA1_4.0 8d432c73ef6e98b81d252114be1a83182cc9607a) -set(LUA_VANILLA_MD5_3.2.2 374ba5c4839709922de40b8d10382705) -set(LUA_VANILLA_SHA1_3.2.2 fa50ff14c00d8523c8a3d1d3f4887ecc4400d0c3) -set(LUA_VANILLA_MD5_3.2.1 47264a1978df49fc1dea6ffcddb05b21) -set(LUA_VANILLA_SHA1_3.2.1 d43af5a1c7a65c0ddb4b0ac06c29ecf4cdd22367) -set(LUA_VANILLA_MD5_3.2 a6552da3d40ae9b04489a788262279e8) -set(LUA_VANILLA_SHA1_3.2 84cf9f0e7d00eed3ea8b4ac2b84254b714510b34) -set(LUA_VANILLA_MD5_3.1 d677f3827167eefdefc7b211397cfdfb) -set(LUA_VANILLA_SHA1_3.1 509485e3baafd946f4ffe2a984f8a63746adc32a) -set(LUA_VANILLA_MD5_3.0 997558ae76c2f1cd1e10fd3835c45c6a) -set(LUA_VANILLA_SHA1_3.0 5c8c910353f717ba29b4fe7d538994454229b335) -set(LUA_VANILLA_MD5_2.5 da915d58904e75b9b0fc18147e19b0bb) -set(LUA_VANILLA_SHA1_2.5 7920e12c40242932c22fa261ff114cc485a39d99) -set(LUA_VANILLA_MD5_2.4 5d035cc244285c1dbbcaaa0908b58965) -set(LUA_VANILLA_SHA1_2.4 74036935b36e6ae4ed17bd7a9408154f9a4a6b17) -set(LUA_VANILLA_MD5_2.2 a298b58e197ff8168ec907d6145252ef) -set(LUA_VANILLA_SHA1_2.2 2d8b1df94b2fb76f0f16ca1ddc54d5186b10df4b) -set(LUA_VANILLA_MD5_2.1 053a9f6728cc56f6a23716a6a1ede595) -set(LUA_VANILLA_SHA1_2.1 b9a797547f480bcb58b5d3da846c8ac8d2201df0) -set(LUA_VANILLA_MD5_1.1 9f83141cc8ea362497e272071eda5cf6) -set(LUA_VANILLA_SHA1_1.1 67209701eec5cc633e829d023fbff62d5d6c8e5e) -set(LUA_VANILLA_MD5_1.0 96e8399fc508d128badd8ac3aa8f2119) -set(LUA_VANILLA_SHA1_1.0 6a82d2ae7ce9ad98c7b4824a325b91522c0d6ebb) +set(LUA_VANILLA_5.3_LATEST_VERSION 5.3.6) +set(LUA_VANILLA_5.4_LATEST_VERSION 5.4.4) # Clean up some variables if (LUA_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") @@ -154,21 +79,6 @@ FIND_PACKAGE_MESSAGE(LUABUILD "Selecting PUC-RIO Lua ${LUA_VANILLA_VERSION} from '${LUA_VERSION}' and building a ${LUA_BUILD_LIBRARY_TYPE} library with ${LUA_VANILLA_LANGUAGE} linkage..." "[${LUA_VANILLA_VERSION}][${LUA_VERSION}][${LUA_BUILD_LIBRARY_TYPE}][${LUA_VANILLA_LANGUAGE}]") -# Get Hashes to use for download -set(LUA_VANILLA_SHA1 ${LUA_VANILLA_SHA1_${LUA_VANILLA_VERSION}}) -set(LUA_VANILLA_MD5 ${LUA_VANILLA_MD5_${LUA_VANILLA_VERSION}}) - -if (LUA_VANILLA_MD5) - set(LUA_VANILLA_DOWNLOAD_MD5_COMMAND URL_MD5 ${LUA_VANILLA_MD5}) -else () - set(LUA_VANILLA_DOWNLOAD_MD5_COMMAND "") -endif() -if (LUA_VANILLA_SHA1) - set(LUA_VANILLA_DOWNLOAD_SHA1_COMMAND URL_HASH SHA1=${LUA_VANILLA_SHA1}) -else () - set(LUA_VANILLA_DOWNLOAD_SHA1_COMMAND "") -endif() - # # # Makefile and self-build configurations # # Potential compiler variables @@ -273,8 +183,6 @@ else() STAMP_DIR "${LUA_BUILD_TOPLEVEL}-stamp" INSTALL_DIR "${LUA_BUILD_INSTALL_DIR}" URL ${LUA_VANILLA_DOWNLOAD_URL} - URL_MD5 ${LUA_VANILLA_MD5} - URL_HASH SHA1=${LUA_VANILLA_SHA1} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" diff --git a/include/sol/stack_check_get_qualified.hpp b/include/sol/stack_check_get_qualified.hpp index b5dfc387..313f7b9e 100644 --- a/include/sol/stack_check_get_qualified.hpp +++ b/include/sol/stack_check_get_qualified.hpp @@ -70,9 +70,8 @@ namespace sol { namespace stack { actual* mem = static_cast(memory); return static_cast(*mem); } - actual r {}; if constexpr (!derive::value) { - return {}; + return OptionalType(); } else { memory = detail::align_usertype_unique_tag(memory); @@ -80,6 +79,7 @@ namespace sol { namespace stack { memory = detail::align_usertype_unique(memory); string_view ti = usertype_traits::qualified_name(); int cast_operation; + actual r {}; if constexpr (is_actual_type_rebindable_for_v) { using rebound_actual_type = unique_usertype_rebind_actual_t; string_view rebind_ti = usertype_traits::qualified_name(); @@ -103,13 +103,13 @@ namespace sol { namespace stack { default: break; } - return {}; + return OptionalType(); } } else { if (!check(L, index, std::forward(handler))) { tracking.use(static_cast(!lua_isnone(L, index))); - return {}; + return OptionalType(); } return OptionalType(stack_detail::unchecked_get(L, index, tracking)); } diff --git a/include/sol/stack_guard.hpp b/include/sol/stack_guard.hpp index a4e05874..6979e9c1 100644 --- a/include/sol/stack_guard.hpp +++ b/include/sol/stack_guard.hpp @@ -31,7 +31,7 @@ namespace sol { namespace detail { inline void stack_fail(int, int) { -#if SOL_IS_ON(SOL_EXCEPTIONS_I_) +#if SOL_IS_ON(SOL_EXCEPTIONS) throw error(detail::direct_error, "imbalanced stack after operation finish"); #else // Lol, what do you want, an error printout? :3c diff --git a/include/sol/usertype_container.hpp b/include/sol/usertype_container.hpp index dcc4562f..5846493b 100644 --- a/include/sol/usertype_container.hpp +++ b/include/sol/usertype_container.hpp @@ -517,7 +517,7 @@ namespace sol { iterator it; std::size_t index; - iter(lua_State* L_, int stack_index, T& source_, iterator it_) : keep_alive(L_, stack_index), source(source_), it(std::move(it_)), index(0) { + iter(lua_State* L_, int stack_index, T& source_, iterator it_) : keep_alive(sol::main_thread(L_, L_), stack_index), source(source_), it(std::move(it_)), index(0) { } ~iter() { @@ -1394,10 +1394,11 @@ namespace sol { T& source; iterator it; - iter(lua_State* L_, int stack_index, T& source, iterator it) noexcept : keep_alive(L_, stack_index), source(source), it(std::move(it)) { + iter(lua_State* L_, int stack_index, T& source, iterator it) noexcept + : keep_alive(sol::main_thread(L_, L_), stack_index), source(source), it(std::move(it)) { } - ~iter () { + ~iter() { } }; diff --git a/scripts/run.linux.sh b/scripts/run.linux.sh index 7b40e371..6397bf66 100644 --- a/scripts/run.linux.sh +++ b/scripts/run.linux.sh @@ -37,7 +37,7 @@ echo -e "travis_fold:start:build_preparation\r" if [ -z "${SOL2_LUA_VERSION}" ] then - export SOL2_LUA_VERSION=5.3.5 + export SOL2_LUA_VERSION=5.4.4 fi if [ -z "${SOL2_PLATFORM}" ] From 0a801ee656d2e8c7070088e728a1227334867876 Mon Sep 17 00:00:00 2001 From: Shepherd Date: Fri, 24 Jun 2022 06:35:12 -0400 Subject: [PATCH 09/53] =?UTF-8?q?=F0=9F=9B=A0=20Guard=20against=20environm?= =?UTF-8?q?ent=20over-pushing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/sol/environment.hpp | 9 ++-- include/sol/stack_push.hpp | 11 +++- tests/environment/source/get.cpp | 53 ++++++++++++------- tests/environment/source/this_environment.cpp | 16 ++++-- 4 files changed, 59 insertions(+), 30 deletions(-) diff --git a/include/sol/environment.hpp b/include/sol/environment.hpp index 8d1e0a38..84c44ac4 100644 --- a/include/sol/environment.hpp +++ b/include/sol/environment.hpp @@ -62,7 +62,7 @@ namespace sol { constructor_handler handler {}; stack::check(this->lua_state(), -1, handler); #endif // Safety - lua_pop(this->lua_state(), 2); + lua_pop(this->lua_state(), 1); } template basic_environment(env_key_t, const basic_reference& extraction_target) @@ -71,7 +71,7 @@ namespace sol { constructor_handler handler {}; stack::check(this->lua_state(), -1, handler); #endif // Safety - lua_pop(this->lua_state(), 2); + lua_pop(this->lua_state(), 1); } basic_environment(lua_State* L, int index = -1) : base_t(detail::no_safety, L, index) { #if SOL_IS_ON(SOL_SAFE_REFERENCES) @@ -136,11 +136,13 @@ namespace sol { const char* success = lua_setupvalue(L, target_index, 1); if (success == nullptr) { // left things alone on the stack, pop them off - lua_pop(L, 1); + lua_pop(L, 2); return false; } + lua_pop(L, 1); return true; } + lua_pop(L, 1); return false; } else { @@ -152,6 +154,7 @@ namespace sol { } string_view upvalue_name(maybe_upvalue_name); if (upvalue_name == "_ENV") { + lua_pop(L, 1); this->push(); const char* success = lua_setupvalue(L, target_index, upvalue_index); if (success == nullptr) { diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 9e35eec8..79a1f431 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,8 @@ #include #endif // Can use variant +#include + namespace sol { namespace stack { namespace stack_detail { template @@ -141,7 +144,11 @@ namespace sol { namespace stack { int push_environment_of(const T& target) { lua_State* target_L = target.lua_state(); int target_index = absolute_index(target_L, -target.push()); - return push_environment_of(target_L, target_index); + int env_count = push_environment_of(target_L, target_index); + sol_c_assert(env_count == 1); + lua_rotate(target_L, target_index, 1); + lua_pop(target_L, 1); + return env_count; } template @@ -316,7 +323,7 @@ namespace sol { namespace stack { if (static_cast(llround(static_cast(value))) != value) { #if SOL_IS_OFF(SOL_EXCEPTIONS) // Is this really worth it? - assert(false && "integer value will be misrepresented in lua"); + sol_m_assert(false, "integer value will be misrepresented in lua"); lua_pushinteger(L, static_cast(value)); return 1; #else diff --git a/tests/environment/source/get.cpp b/tests/environment/source/get.cpp index 5281c4b2..36b446ad 100644 --- a/tests/environment/source/get.cpp +++ b/tests/environment/source/get.cpp @@ -57,12 +57,14 @@ inline namespace sol2_tests_environments_get { sol::state& lua = *plua; sol::environment& env_f = *penv_f; sol::stack_guard luasg(lua); - sol::environment target_env(sol::env_key, target); - int test_env_f = env_f["test"]; - int test_target_env = target_env["test"]; - REQUIRE(test_env_f == test_target_env); - REQUIRE(test_env_f == 31); - REQUIRE(env_f == target_env); + { + sol::environment target_env(sol::env_key, target); + int test_env_f = env_f["test"]; + int test_target_env = target_env["test"]; + REQUIRE(test_env_f == test_target_env); + REQUIRE(test_env_f == 31); + REQUIRE(env_f == target_env); + } } }; @@ -89,20 +91,27 @@ TEST_CASE("environments/get", "Envronments can be taken out of things like Lua f lua.open_libraries(sol::lib::base); - auto result1 = lua.safe_script("f = function() return test end", sol::script_pass_on_error); - REQUIRE(result1.valid()); + { + auto result1 = lua.safe_script("f = function() return test end", sol::script_pass_on_error); + REQUIRE(result1.valid()); + } sol::function f = lua["f"]; sol::environment env_f(lua, sol::create); env_f["test"] = 31; - bool env_f_was_set = sol::set_environment(env_f, f); - REQUIRE(env_f_was_set); + { + sol::stack_guard luasgf(lua); + bool env_f_was_set = sol::set_environment(env_f, f); + REQUIRE(env_f_was_set); + } int result = f(); REQUIRE(result == 31); - auto result2 = lua.safe_script("g = function() test = 5 end", sol::script_pass_on_error); - REQUIRE(result2.valid()); + { + auto result2 = lua.safe_script("g = function() test = 5 end", sol::script_pass_on_error); + REQUIRE(result2.valid()); + } sol::function g = lua["g"]; sol::environment env_g(lua, sol::create); bool env_g_was_set = env_g.set_on(g); @@ -116,17 +125,21 @@ TEST_CASE("environments/get", "Envronments can be taken out of things like Lua f sol::object global_test = lua["test"]; REQUIRE(!global_test.valid()); - auto result3 = lua.safe_script("h = function() end", sol::script_pass_on_error); - REQUIRE(result3.valid()); + { + auto result3 = lua.safe_script("h = function() end", sol::script_pass_on_error); + REQUIRE(result3.valid()); + } lua.set_function("check_f_env", check_f_env(lua, env_f)); lua.set_function("check_g_env", check_g_env(lua, env_g)); lua.set_function("check_h_env", check_h_env(lua)); - auto checkf = lua.safe_script("check_f_env(f)", sol::script_pass_on_error); - REQUIRE(checkf.valid()); - auto checkg = lua.safe_script("check_g_env(g)", sol::script_pass_on_error); - REQUIRE(checkg.valid()); - auto checkh = lua.safe_script("check_h_env(h)", sol::script_pass_on_error); - REQUIRE(checkh.valid()); + { + auto checkf = lua.safe_script("check_f_env(f)", sol::script_pass_on_error); + REQUIRE(checkf.valid()); + auto checkg = lua.safe_script("check_g_env(g)", sol::script_pass_on_error); + REQUIRE(checkg.valid()); + auto checkh = lua.safe_script("check_h_env(h)", sol::script_pass_on_error); + REQUIRE(checkh.valid()); + } } diff --git a/tests/environment/source/this_environment.cpp b/tests/environment/source/this_environment.cpp index ed796a6b..4fe5c0b9 100644 --- a/tests/environment/source/this_environment.cpp +++ b/tests/environment/source/this_environment.cpp @@ -44,15 +44,21 @@ TEST_CASE("environments/this_environment", "test various situations of pulling o lua["x"] = 5; e["x"] = 20; SECTION("from Lua script") { - auto result1 = lua.safe_script(code, e, sol::script_pass_on_error); - REQUIRE(result1.valid()); - int value = result1; + int value = 0; + { + auto result1 = lua.safe_script(code, e, sol::script_pass_on_error); + REQUIRE(result1.valid()); + value = result1; + } REQUIRE(value == 30); } SECTION("from C++") { sol::function f = lua["f"]; - bool env_set = e.set_on(f); - REQUIRE(env_set); + { + sol::stack_guard luasg_env(lua); + bool env_set = e.set_on(f); + REQUIRE(env_set); + } int value = f(10); REQUIRE(value == 30); } From 323c3ca2101238a7fd251103634df5e5d415a8a7 Mon Sep 17 00:00:00 2001 From: Shepherd Date: Fri, 24 Jun 2022 07:43:54 -0400 Subject: [PATCH 10/53] =?UTF-8?q?=F0=9F=9B=A0=20Prevent=20non-zero=20defau?= =?UTF-8?q?lt=20initialization=20for=20result=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/sol/load_result.hpp | 6 ++++-- include/sol/protected_function_result.hpp | 2 +- include/sol/unsafe_function_result.hpp | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/sol/load_result.hpp b/include/sol/load_result.hpp index 60c14b65..07c119f8 100644 --- a/include/sol/load_result.hpp +++ b/include/sol/load_result.hpp @@ -39,7 +39,7 @@ namespace sol { load_status err; public: - load_result() noexcept = default; + load_result() noexcept : load_result(nullptr) {} load_result(lua_State* Ls, int stackindex = -1, int retnum = 0, int popnum = 0, load_status lerr = load_status::ok) noexcept : L(Ls), index(stackindex), returncount(retnum), popcount(popnum), err(lerr) { } @@ -142,7 +142,9 @@ namespace sol { }; ~load_result() { - stack::remove(L, index, popcount); + if (L != nullptr) { + stack::remove(L, index, popcount); + } } }; } // namespace sol diff --git a/include/sol/protected_function_result.hpp b/include/sol/protected_function_result.hpp index d806177e..afcbc1c2 100644 --- a/include/sol/protected_function_result.hpp +++ b/include/sol/protected_function_result.hpp @@ -54,7 +54,7 @@ namespace sol { typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; - protected_function_result() noexcept = default; + protected_function_result() noexcept : protected_function_result(nullptr) {} protected_function_result(lua_State* Ls, int idx = -1, int retnum = 0, int popped = 0, call_status pferr = call_status::ok) noexcept : L(Ls), index(idx), returncount(retnum), popcount(popped), err(pferr) { } diff --git a/include/sol/unsafe_function_result.hpp b/include/sol/unsafe_function_result.hpp index d340f0de..c5e976ff 100644 --- a/include/sol/unsafe_function_result.hpp +++ b/include/sol/unsafe_function_result.hpp @@ -50,7 +50,7 @@ namespace sol { typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; - unsafe_function_result() noexcept = default; + unsafe_function_result() noexcept : unsafe_function_result(nullptr) {} unsafe_function_result(lua_State* Ls, int idx = -1, int retnum = 0) noexcept : L(Ls), index(idx), returncount(retnum) { } @@ -158,7 +158,9 @@ namespace sol { returncount = 0; } ~unsafe_function_result() { - lua_pop(L, returncount); + if (L != nullptr) { + lua_pop(L, returncount); + } } }; From 3b97af0ac417c6f5ee2d16fa4c2cab2885409352 Mon Sep 17 00:00:00 2001 From: Shepherd Date: Fri, 24 Jun 2022 09:51:09 -0400 Subject: [PATCH 11/53] =?UTF-8?q?=F0=9F=9B=A0=20Clean=20up=20old=20VC++=20?= =?UTF-8?q?code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — 🔎 Silence uninitialized warning for later inspection --- include/sol/protected_function_result.hpp | 9 ++++++ include/sol/stack_check_get_qualified.hpp | 9 ++++++ include/sol/stack_core.hpp | 14 ++------- include/sol/stack_get_unqualified.hpp | 36 ++++++----------------- include/sol/stack_push.hpp | 2 -- include/sol/usertype_storage.hpp | 3 ++ 6 files changed, 32 insertions(+), 41 deletions(-) diff --git a/include/sol/protected_function_result.hpp b/include/sol/protected_function_result.hpp index afcbc1c2..5859a7ae 100644 --- a/include/sol/protected_function_result.hpp +++ b/include/sol/protected_function_result.hpp @@ -99,6 +99,11 @@ namespace sol { return status() == call_status::ok || status() == call_status::yielded; } +#if SOL_IS_ON(SOL_COMPILER_GCC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + template decltype(auto) get(int index_offset = 0) const { using UT = meta::unqualified_t; @@ -140,6 +145,10 @@ namespace sol { } } +#if SOL_IS_ON(SOL_COMPILER_GCC) +#pragma GCC diagnostic pop +#endif + type get_type(int index_offset = 0) const noexcept { return type_of(L, index + static_cast(index_offset)); } diff --git a/include/sol/stack_check_get_qualified.hpp b/include/sol/stack_check_get_qualified.hpp index 313f7b9e..102e213e 100644 --- a/include/sol/stack_check_get_qualified.hpp +++ b/include/sol/stack_check_get_qualified.hpp @@ -30,6 +30,11 @@ namespace sol { namespace stack { +#if SOL_IS_ON(SOL_COMPILER_GCC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + namespace stack_detail { template OptionalType get_optional(lua_State* L, int index, Handler&& handler, record& tracking) { @@ -116,6 +121,10 @@ namespace sol { namespace stack { } } // namespace stack_detail +#if SOL_IS_ON(SOL_COMPILER_GCC) +#pragma GCC diagnostic pop +#endif + template struct qualified_check_getter { typedef decltype(stack_detail::unchecked_get(nullptr, -1, std::declval())) R; diff --git a/include/sol/stack_core.hpp b/include/sol/stack_core.hpp index eca4f969..4feca049 100644 --- a/include/sol/stack_core.hpp +++ b/include/sol/stack_core.hpp @@ -709,7 +709,6 @@ namespace sol { } else { unqualified_getter g {}; - (void)g; return g.get(L, index, tracking); } } @@ -721,7 +720,6 @@ namespace sol { } else { qualified_getter g {}; - (void)g; return g.get(L, index, tracking); } } @@ -877,7 +875,6 @@ namespace sol { } else { unqualified_pusher p {}; - (void)p; return p.push(L, std::forward(t), std::forward(args)...); } } @@ -897,7 +894,6 @@ namespace sol { } else { unqualified_pusher p {}; - (void)p; return p.push(L, std::forward(arg), std::forward(args)...); } } @@ -983,9 +979,7 @@ namespace sol { return sol_lua_check(types(), L, index, std::forward(handler), tracking); } else { - unqualified_checker> c; - // VC++ has a bad warning here: shut it up - (void)c; + unqualified_checker> c{}; return c.check(L, index, std::forward(handler), tracking); } } @@ -1009,9 +1003,7 @@ namespace sol { } else { using Tu = meta::unqualified_t; - qualified_checker> c; - // VC++ has a bad warning here: shut it up - (void)c; + qualified_checker> c{}; return c.check(L, index, std::forward(handler), tracking); } } @@ -1065,7 +1057,6 @@ namespace sol { } else { unqualified_check_getter cg {}; - (void)cg; return cg.get(L, index, std::forward(handler), tracking); } } @@ -1089,7 +1080,6 @@ namespace sol { } else { qualified_check_getter cg {}; - (void)cg; return cg.get(L, index, std::forward(handler), tracking); } } diff --git a/include/sol/stack_get_unqualified.hpp b/include/sol/stack_get_unqualified.hpp index b9976d93..1764089a 100644 --- a/include/sol/stack_get_unqualified.hpp +++ b/include/sol/stack_get_unqualified.hpp @@ -581,23 +581,17 @@ namespace sol { namespace stack { typedef typename T::value_type P; typedef typename P::first_type K; typedef typename P::second_type V; - unqualified_getter> g; - // VC++ has a bad warning here: shut it up - (void)g; + unqualified_getter> g{}; return g.get(types>(), L, index, tracking); } else { typedef typename T::value_type V; - unqualified_getter> g; - // VC++ has a bad warning here: shut it up - (void)g; + unqualified_getter> g{}; return g.get(types>(), L, index, tracking); } } else { - unqualified_getter g; - // VC++ has a bad warning here: shut it up - (void)g; + unqualified_getter g{}; return g.get(L, index, tracking); } } @@ -933,9 +927,7 @@ namespace sol { namespace stack { tracking.use(1); return nullptr; } - unqualified_getter> g; - // Avoid VC++ warning - (void)g; + unqualified_getter> g{}; return g.get_no_lua_nil(L, index, tracking); } }; @@ -943,9 +935,7 @@ namespace sol { namespace stack { template struct unqualified_getter> { static T* get(lua_State* L, int index, record& tracking) { - unqualified_getter> g; - // Avoid VC++ warning - (void)g; + unqualified_getter> g{}; return g.get_no_lua_nil(L, index, tracking); } }; @@ -953,9 +943,7 @@ namespace sol { namespace stack { template struct unqualified_getter { static T& get(lua_State* L, int index, record& tracking) { - unqualified_getter> g; - // Avoid VC++ warning - (void)g; + unqualified_getter> g{}; return g.get(L, index, tracking); } }; @@ -963,9 +951,7 @@ namespace sol { namespace stack { template struct unqualified_getter> { static T& get(lua_State* L, int index, record& tracking) { - unqualified_getter g; - // Avoid VC++ warning - (void)g; + unqualified_getter g{}; return g.get(L, index, tracking); } }; @@ -978,15 +964,11 @@ namespace sol { namespace stack { return stack_detail::get_function_pointer(L, index, tracking); } else { - unqualified_getter> g; - // Avoid VC++ warning - (void)g; + unqualified_getter> g{}; return g.get(L, index, tracking); } #else - unqualified_getter> g; - // Avoid VC++ warning - (void)g; + unqualified_getter> g{}; return g.get(L, index, tracking); #endif } diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 79a1f431..6640c0a2 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -513,8 +513,6 @@ namespace sol { namespace stack { struct unqualified_pusher> { static int push(lua_State* L, const std::initializer_list& il) noexcept { unqualified_pusher>> p {}; - // silence annoying VC++ warning - (void)p; return p.push(L, il); } }; diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index 22c2add0..9450367a 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -308,12 +308,15 @@ namespace sol { namespace u_detail { usertype_storage_base(lua_State* L_) : m_L(L_) , storage() + , string_keys_storage() , string_keys() , auxiliary_keys(0, stateless_reference_hash(L_), stateless_reference_equals(L_)) , value_index_table() , reference_index_table() , unique_index_table() , const_reference_index_table() + , const_value_index_table() + , named_index_table() , type_table(make_reference(L_, create)) , gc_names_table(make_reference(L_, create)) , named_metatable(make_reference(L_, create)) From de0e9de81630e146490cf3e520c4ece690645254 Mon Sep 17 00:00:00 2001 From: Daniel Volk Date: Mon, 9 May 2022 16:54:30 +0200 Subject: [PATCH 12/53] CMake: Build LuaJIT: use copy_if_different Use copy_if_different to move luajit products in the post build step to avoid relinking of projects depending on sol2/luagit. This is mostly relevant when building sol2 and luajit as subprojects. --- cmake/Packages/FindLuaBuild/LuaJIT.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/Packages/FindLuaBuild/LuaJIT.cmake b/cmake/Packages/FindLuaBuild/LuaJIT.cmake index 557f29d6..98001aa5 100644 --- a/cmake/Packages/FindLuaBuild/LuaJIT.cmake +++ b/cmake/Packages/FindLuaBuild/LuaJIT.cmake @@ -319,20 +319,20 @@ endif() # # Post-Build moving steps for necessary items # Add post-step to move library afterwards set(LUA_JIT_POSTBUILD_COMMENTS "Executable - Moving \"${LUA_JIT_SOURCE_LUA_INTERPRETER}\" to \"${LUA_JIT_DESTINATION_LUA_INTERPRETER}\"...") -set(LUA_JIT_POSTBUILD_COMMANDS COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_INTERPRETER}" "${LUA_JIT_DESTINATION_LUA_INTERPRETER}") +set(LUA_JIT_POSTBUILD_COMMANDS COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${LUA_JIT_SOURCE_LUA_INTERPRETER}" "${LUA_JIT_DESTINATION_LUA_INTERPRETER}") if (BUILD_LUA_AS_DLL) if (MSVC) set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS} Import Library - Moving \"${LUA_JIT_SOURCE_LUA_IMP_LIB}\" to \"${LUA_JIT_DESTINATION_LUA_IMP_LIB}\"...") - set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_IMP_LIB}" "${LUA_JIT_DESTINATION_LUA_IMP_LIB}") + set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${LUA_JIT_SOURCE_LUA_IMP_LIB}" "${LUA_JIT_DESTINATION_LUA_IMP_LIB}") set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS} Library - Moving \"${LUA_JIT_SOURCE_LUA_LIB_EXP}\" to \"${LUA_JIT_DESTINATION_LUA_LIB_EXP}\"...") - set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} && "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_LIB_EXP}" "${LUA_JIT_DESTINATION_LUA_LIB_EXP}") + set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} && "${CMAKE_COMMAND}" -E copy_if_different "${LUA_JIT_SOURCE_LUA_LIB_EXP}" "${LUA_JIT_DESTINATION_LUA_LIB_EXP}") endif() set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS} Dynamic Library - Moving \"${LUA_JIT_SOURCE_LUA_DLL}\" to \"${LUA_JIT_DESTINATION_LUA_DLL}\"...") - set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_DLL}" "${LUA_JIT_DESTINATION_LUA_DLL}") + set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${LUA_JIT_SOURCE_LUA_DLL}" "${LUA_JIT_DESTINATION_LUA_DLL}") else() set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS} Library - Moving \"${LUA_JIT_SOURCE_LUA_LIB}\" to \"${LUA_JIT_DESTINATION_LUA_LIB}\"...") - set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_LIB}" "${LUA_JIT_DESTINATION_LUA_LIB}") + set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${LUA_JIT_SOURCE_LUA_LIB}" "${LUA_JIT_DESTINATION_LUA_LIB}") endif() if (LUA_LOCAL_DIR) From 13b7e8a7ca2513ad76f86f20928efaa3a6403849 Mon Sep 17 00:00:00 2001 From: Matus Fedorko Date: Fri, 12 Nov 2021 13:57:28 +0100 Subject: [PATCH 13/53] Fix compile error when registering new user types with operator() --- include/sol/bind_traits.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sol/bind_traits.hpp b/include/sol/bind_traits.hpp index c0b5b268..ca46e474 100644 --- a/include/sol/bind_traits.hpp +++ b/include/sol/bind_traits.hpp @@ -31,7 +31,7 @@ namespace sol { namespace meta { namespace meta_detail { template - using detect_deducible_signature = decltype(&F::operator(), void()); + using detect_deducible_signature = decltype(&F::operator()); } // namespace meta_detail template From c9055478c7c437f9a97610329701652673ab8262 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 14 May 2022 16:52:27 +0000 Subject: [PATCH 14/53] fix #1354 --- include/sol/stack_push.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 6640c0a2..80de5b72 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -657,7 +657,7 @@ namespace sol { namespace stack { #if SOL_IS_ON(SOL_SAFE_STACK_CHECK) luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); #endif // make sure stack doesn't overflow - lua_pushlightuserdata(L, static_cast(l.value)); + lua_pushlightuserdata(L, static_cast(l.value())); return 1; } }; From 55828d1ee0c21631d144e7d15df37711cc545f7f Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 25 Jun 2022 03:42:51 -0400 Subject: [PATCH 15/53] Fix #1266 --- include/sol/stack.hpp | 13 +++- include/sol/table_core.hpp | 2 +- ...add method in Lua 5.4 showing freelist.cpp | 65 +++++++++++++++++++ 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp diff --git a/include/sol/stack.hpp b/include/sol/stack.hpp index 971db3d7..90e84598 100644 --- a/include/sol/stack.hpp +++ b/include/sol/stack.hpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -200,11 +201,21 @@ namespace sol { argument_types_, argument_indices_, L_, start_index_, handler, tracking, std::forward(fx_), std::forward(args_)...); } } + + template + void raw_table_set(lua_State* L, T&& arg, int tableindex = -2) { + int push_count = push(L, std::forward(arg)); + sol_c_assert(push_count == 1); + std::size_t unique_index = static_cast(luaL_len(L, tableindex) + 1u); + lua_rawseti(L, tableindex, unique_index); + } + } // namespace stack_detail template int set_ref(lua_State* L, T&& arg, int tableindex = -2) { - push(L, std::forward(arg)); + int push_count = push(L, std::forward(arg)); + sol_c_assert(push_count == 1); return luaL_ref(L, tableindex); } diff --git a/include/sol/table_core.hpp b/include/sol/table_core.hpp index 45c9d3a8..21080baa 100644 --- a/include/sol/table_core.hpp +++ b/include/sol/table_core.hpp @@ -644,7 +644,7 @@ namespace sol { auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); lua_State* L = base_t::lua_state(); - (void)detail::swallow { 0, (stack::set_ref(L, std::forward(args), table_index), 0)... }; + (void)detail::swallow { 0, (stack::stack_detail::raw_table_set(L, std::forward(args), table_index), 0)... }; return *this; } diff --git a/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp b/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp new file mode 100644 index 00000000..f4dc9012 --- /dev/null +++ b/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp @@ -0,0 +1,65 @@ +// 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. + +#include + +#include + +#include + +TEST_CASE("Test for Issue #1266 - add method in Lua 5.4 exposes freelist in table, unfortunately", "[sol2][regression][Issue-1266]") { + sol::state lua; + lua.open_libraries(sol::lib::base); + + const auto& code = R"( +for k, v in pairs(table) do + assert(k == 1) assert(v == 'item') +end)"; + + SECTION("sol2 API") { + // Create and add using sol. + sol::table table = lua.create_table(); + table.add("item"); + lua["table"] = table; + + auto result = lua.safe_script(code, sol::script_pass_on_error); + REQUIRE(result.valid()); + } + SECTION("sol2 + C API") { + // Create using C API and add using sol. + lua_createtable(lua.lua_state(), 0, 0); + lua_setglobal(lua.lua_state(), "table"); + sol::table table = lua["table"]; + table.add("item"); + + auto result = lua.safe_script(code, sol::script_pass_on_error); + REQUIRE(result.valid()); + } + + sol::table table = lua["table"]; + REQUIRE(table.size() == 1); + std::string table_value = table[1]; + std::string table_value_at_size = table[table.size()]; + REQUIRE(table_value == "item"); + REQUIRE(table_value_at_size == "item"); +} From 17e1c951dca45bbb10259985ec69bd063808e5fc Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 25 Jun 2022 03:47:22 -0400 Subject: [PATCH 16/53] =?UTF-8?q?=F0=9F=9B=A0=20Fix=20#1328?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/run_time/source/policies.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/run_time/source/policies.cpp b/tests/run_time/source/policies.cpp index d6d7cfd2..64264fea 100644 --- a/tests/run_time/source/policies.cpp +++ b/tests/run_time/source/policies.cpp @@ -27,6 +27,7 @@ #include #include +#include TEST_CASE("policies/self", "ensure we return a direct reference to the lua userdata rather than creating a new one") { struct vec2 { From ce40e894d06fcbe5a019240a10dfe635f8d1ccd0 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 25 Jun 2022 04:00:53 -0400 Subject: [PATCH 17/53] =?UTF-8?q?=E2=9C=8D=20Update=20Copyright=20Year?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .clang-format | 2 +- .dockerignore | 2 +- .gitignore | 6 +++--- CMakeLists.txt | 2 +- LICENSE.txt | 2 +- cmake/Includes/Project.cmake | 2 +- cmake/Modules/CheckCompilerDiagnostic.cmake | 4 ++-- cmake/Modules/CheckCompilerFlag.cmake | 2 +- cmake/Modules/Common/Core.cmake | 2 +- cmake/Modules/FindVersion.cmake | 2 +- cmake/Packages/FindKaguyaBuild.cmake | 4 ++-- cmake/Packages/FindLua/set_version_vars.cmake | 4 ++-- cmake/Packages/FindLuaBridgeBuild.cmake | 4 +--- cmake/Packages/FindLuaBuild.cmake | 2 +- cmake/Packages/FindLuaBuild/LuaJIT.cmake | 2 +- cmake/Packages/FindLuaBuild/LuaVanilla.cmake | 2 +- cmake/Packages/FindLuwraBuild.cmake | 2 +- cmake/Packages/FindSphinx.cmake | 4 ++-- cmake/Packages/FindToLuappBuild.cmake | 2 +- cmake/sol2-config.cmake.in | 2 +- documentation/.clang-format | 2 +- documentation/CMakeLists.txt | 2 +- documentation/Doxyfile.in | 2 +- examples/.clang-format | 2 +- examples/CMakeLists.txt | 2 +- examples/customization/CMakeLists.txt | 2 +- examples/interop/LuaBridge/CMakeLists.txt | 2 +- examples/interop/kaguya/CMakeLists.txt | 2 +- examples/interop/luwra/CMakeLists.txt | 2 +- examples/interop/tolua/CMakeLists.txt | 2 +- examples/require_dll_example/CMakeLists.txt | 2 +- include/sol/as_args.hpp | 2 +- include/sol/as_returns.hpp | 2 +- include/sol/assert.hpp | 2 +- include/sol/base_traits.hpp | 2 +- include/sol/bind_traits.hpp | 2 +- include/sol/bytecode.hpp | 2 +- include/sol/call.hpp | 2 +- include/sol/compatibility.hpp | 2 +- include/sol/compatibility/lua_version.hpp | 2 +- include/sol/config.hpp | 2 +- include/sol/coroutine.hpp | 2 +- include/sol/debug.hpp | 2 +- include/sol/demangle.hpp | 2 +- include/sol/deprecate.hpp | 2 +- include/sol/detail/build_version.hpp | 2 +- include/sol/dump_handler.hpp | 2 +- include/sol/ebco.hpp | 2 +- include/sol/environment.hpp | 2 +- include/sol/epilogue.hpp | 2 +- include/sol/error.hpp | 2 +- include/sol/error_handler.hpp | 2 +- include/sol/forward.hpp | 2 +- include/sol/forward_detail.hpp | 2 +- include/sol/function.hpp | 2 +- include/sol/function_result.hpp | 2 +- include/sol/function_types.hpp | 2 +- include/sol/function_types_core.hpp | 2 +- include/sol/function_types_overloaded.hpp | 4 ++-- include/sol/function_types_stateful.hpp | 2 +- include/sol/function_types_stateless.hpp | 2 +- include/sol/function_types_templated.hpp | 2 +- include/sol/in_place.hpp | 2 +- include/sol/inheritance.hpp | 2 +- include/sol/load_result.hpp | 2 +- include/sol/lua_table.hpp | 2 +- include/sol/lua_value.hpp | 2 +- include/sol/make_reference.hpp | 2 +- include/sol/metatable.hpp | 2 +- include/sol/object.hpp | 2 +- include/sol/object_base.hpp | 2 +- include/sol/optional.hpp | 2 +- include/sol/optional_implementation.hpp | 2 +- include/sol/overload.hpp | 4 ++-- include/sol/packaged_coroutine.hpp | 2 +- include/sol/pairs_iterator.hpp | 2 +- include/sol/pointer_like.hpp | 2 +- include/sol/policies.hpp | 2 +- include/sol/prologue.hpp | 2 +- include/sol/property.hpp | 2 +- include/sol/protect.hpp | 2 +- include/sol/protected_function.hpp | 2 +- include/sol/protected_function_result.hpp | 2 +- include/sol/protected_handler.hpp | 2 +- include/sol/proxy_base.hpp | 2 +- include/sol/raii.hpp | 2 +- include/sol/reference.hpp | 2 +- include/sol/resolve.hpp | 2 +- include/sol/sol.hpp | 2 +- include/sol/stack.hpp | 2 +- include/sol/stack/detail/pairs.hpp | 2 +- include/sol/stack_check.hpp | 2 +- include/sol/stack_check_get.hpp | 2 +- include/sol/stack_check_get_qualified.hpp | 2 +- include/sol/stack_check_get_unqualified.hpp | 2 +- include/sol/stack_check_qualified.hpp | 2 +- include/sol/stack_check_unqualified.hpp | 2 +- include/sol/stack_core.hpp | 2 +- include/sol/stack_field.hpp | 2 +- include/sol/stack_get.hpp | 2 +- include/sol/stack_get_qualified.hpp | 2 +- include/sol/stack_get_unqualified.hpp | 2 +- include/sol/stack_guard.hpp | 2 +- include/sol/stack_iterator.hpp | 2 +- include/sol/stack_pop.hpp | 2 +- include/sol/stack_probe.hpp | 4 ++-- include/sol/stack_proxy.hpp | 2 +- include/sol/stack_proxy_base.hpp | 2 +- include/sol/stack_push.hpp | 2 +- include/sol/stack_reference.hpp | 2 +- include/sol/state.hpp | 2 +- include/sol/state_handling.hpp | 2 +- include/sol/state_view.hpp | 2 +- include/sol/string_view.hpp | 2 +- include/sol/table.hpp | 2 +- include/sol/table_core.hpp | 2 +- include/sol/table_iterator.hpp | 2 +- include/sol/table_proxy.hpp | 2 +- include/sol/thread.hpp | 2 +- include/sol/tie.hpp | 2 +- include/sol/traits.hpp | 2 +- include/sol/trampoline.hpp | 2 +- include/sol/tuple.hpp | 2 +- include/sol/types.hpp | 2 +- include/sol/unique_usertype_traits.hpp | 2 +- include/sol/unsafe_function.hpp | 2 +- include/sol/unsafe_function_result.hpp | 2 +- include/sol/userdata.hpp | 2 +- include/sol/usertype.hpp | 2 +- include/sol/usertype_container.hpp | 2 +- include/sol/usertype_container_launch.hpp | 2 +- include/sol/usertype_core.hpp | 2 +- include/sol/usertype_proxy.hpp | 2 +- include/sol/usertype_storage.hpp | 2 +- include/sol/usertype_traits.hpp | 2 +- include/sol/variadic_args.hpp | 2 +- include/sol/variadic_results.hpp | 2 +- include/sol/version.hpp | 2 +- include/sol/wrapper.hpp | 2 +- scripts/build.linux.sh | 2 +- scripts/preparation.linux.sh | 2 +- scripts/preparation.osx.sh | 2 +- scripts/push.linux.sh | 2 +- scripts/run.linux.sh | 2 +- scripts/run.osx.sh | 2 +- tests/CMakeLists.txt | 2 +- tests/config_tests/CMakeLists.txt | 2 +- tests/config_tests/function_pointers/CMakeLists.txt | 2 +- tests/config_tests/function_pointers/source/main.cpp | 2 +- tests/config_tests/function_pointers/source/retrieval.cpp | 2 +- tests/config_tests/integer_value_fits/CMakeLists.txt | 4 ++-- tests/config_tests/integer_value_fits/source/main.cpp | 2 +- .../integer_value_fits/source/negative_size_t.cpp | 2 +- tests/enum/CMakeLists.txt | 2 +- tests/enum/source/main.cpp | 2 +- tests/enum/source/read_only_iteration.cpp | 2 +- tests/environment/CMakeLists.txt | 2 +- tests/environment/source/get.cpp | 2 +- tests/environment/source/main.cpp | 2 +- tests/environment/source/sandboxing.cpp | 2 +- tests/environment/source/shadowing.cpp | 2 +- tests/environment/source/this_environment.cpp | 2 +- tests/exceptions/CMakeLists.txt | 2 +- tests/exceptions/source/functions.cpp | 2 +- tests/exceptions/source/functions.noexcept.cpp | 2 +- tests/exceptions/source/functions.yielding.cpp | 2 +- tests/exceptions/source/main.cpp | 2 +- tests/exceptions/source/usertypes.cpp | 2 +- tests/exceptions/source/usertypes.yielding.cpp | 2 +- tests/inclusion/CMakeLists.txt | 2 +- tests/inclusion/source/as_args.cpp | 2 +- tests/inclusion/source/as_returns.cpp | 2 +- tests/inclusion/source/base_traits.cpp | 2 +- tests/inclusion/source/bind_traits.cpp | 2 +- tests/inclusion/source/bytecode.cpp | 2 +- tests/inclusion/source/call.cpp | 2 +- tests/inclusion/source/compatibility.cpp | 2 +- tests/inclusion/source/compatibility/compat-5.3.cpp | 2 +- tests/inclusion/source/compatibility/lua_version.cpp | 2 +- tests/inclusion/source/config.cpp | 2 +- tests/inclusion/source/coroutine.cpp | 2 +- tests/inclusion/source/debug.cpp | 2 +- tests/inclusion/source/demangle.cpp | 2 +- tests/inclusion/source/deprecate.cpp | 2 +- tests/inclusion/source/detail/build_version.cpp | 2 +- tests/inclusion/source/ebco.cpp | 2 +- tests/inclusion/source/environment.cpp | 2 +- tests/inclusion/source/error_handler.cpp | 2 +- tests/inclusion/source/forward.cpp | 2 +- tests/inclusion/source/forward_detail.cpp | 2 +- tests/inclusion/source/function.cpp | 2 +- tests/inclusion/source/function_result.cpp | 2 +- tests/inclusion/source/function_types.cpp | 2 +- tests/inclusion/source/function_types_core.cpp | 2 +- tests/inclusion/source/function_types_overloaded.cpp | 2 +- tests/inclusion/source/function_types_stateful.cpp | 2 +- tests/inclusion/source/function_types_stateless.cpp | 2 +- tests/inclusion/source/function_types_templated.cpp | 2 +- tests/inclusion/source/in_place.cpp | 2 +- tests/inclusion/source/inheritance.cpp | 2 +- tests/inclusion/source/load_result.cpp | 2 +- tests/inclusion/source/lua_table.cpp | 2 +- tests/inclusion/source/lua_value.cpp | 2 +- tests/inclusion/source/main.cpp | 4 ++-- tests/inclusion/source/make_reference.cpp | 2 +- tests/inclusion/source/metatable.cpp | 2 +- tests/inclusion/source/object.cpp | 2 +- tests/inclusion/source/object_base.cpp | 2 +- tests/inclusion/source/optional.cpp | 2 +- tests/inclusion/source/optional_implementation.cpp | 2 +- tests/inclusion/source/overload.cpp | 2 +- tests/inclusion/source/packaged_coroutine.cpp | 2 +- tests/inclusion/source/pairs_iterator.cpp | 2 +- tests/inclusion/source/pointer_like.cpp | 2 +- tests/inclusion/source/policies.cpp | 2 +- tests/inclusion/source/property.cpp | 2 +- tests/inclusion/source/protect.cpp | 2 +- tests/inclusion/source/protected_function.cpp | 2 +- tests/inclusion/source/protected_function_result.cpp | 2 +- tests/inclusion/source/protected_handler.cpp | 2 +- tests/inclusion/source/proxy.cpp | 2 +- tests/inclusion/source/proxy_base.cpp | 2 +- tests/inclusion/source/raii.cpp | 2 +- tests/inclusion/source/reference.cpp | 2 +- tests/inclusion/source/resolve.cpp | 2 +- tests/inclusion/source/sol.cpp | 2 +- tests/inclusion/source/stack.cpp | 2 +- tests/inclusion/source/stack/detail/pairs.cpp | 2 +- tests/inclusion/source/stack_check.cpp | 2 +- tests/inclusion/source/stack_check_get.cpp | 2 +- tests/inclusion/source/stack_check_get_qualified.cpp | 2 +- tests/inclusion/source/stack_check_get_unqualified.cpp | 2 +- tests/inclusion/source/stack_check_qualified.cpp | 2 +- tests/inclusion/source/stack_check_unqualified.cpp | 2 +- tests/inclusion/source/stack_core.cpp | 2 +- tests/inclusion/source/stack_field.cpp | 2 +- tests/inclusion/source/stack_get.cpp | 2 +- tests/inclusion/source/stack_get_qualified.cpp | 2 +- tests/inclusion/source/stack_get_unqualified.cpp | 2 +- tests/inclusion/source/stack_guard.cpp | 2 +- tests/inclusion/source/stack_iterator.cpp | 2 +- tests/inclusion/source/stack_pop.cpp | 2 +- tests/inclusion/source/stack_probe.cpp | 2 +- tests/inclusion/source/stack_proxy.cpp | 2 +- tests/inclusion/source/stack_proxy_base.cpp | 2 +- tests/inclusion/source/stack_push.cpp | 2 +- tests/inclusion/source/stack_reference.cpp | 2 +- tests/inclusion/source/state_handling.cpp | 2 +- tests/inclusion/source/string_view.cpp | 2 +- tests/inclusion/source/table.cpp | 2 +- tests/inclusion/source/table_core.cpp | 2 +- tests/inclusion/source/table_iterator.cpp | 2 +- tests/inclusion/source/thread.cpp | 2 +- tests/inclusion/source/tie.cpp | 2 +- tests/inclusion/source/traits.cpp | 2 +- tests/inclusion/source/trampoline.cpp | 2 +- tests/inclusion/source/tuple.cpp | 2 +- tests/inclusion/source/types.cpp | 2 +- tests/inclusion/source/unicode.cpp | 2 +- tests/inclusion/source/unique_usertype_traits.cpp | 2 +- tests/inclusion/source/unsafe_function.cpp | 2 +- tests/inclusion/source/unsafe_function_result.cpp | 2 +- tests/inclusion/source/userdata.cpp | 2 +- tests/inclusion/source/usertype.cpp | 2 +- tests/inclusion/source/usertype_container.cpp | 2 +- tests/inclusion/source/usertype_container_launch.cpp | 2 +- tests/inclusion/source/usertype_core.cpp | 2 +- tests/inclusion/source/usertype_proxy.cpp | 2 +- tests/inclusion/source/usertype_storage.cpp | 2 +- tests/inclusion/source/usertype_traits.cpp | 2 +- tests/inclusion/source/variadic_args.cpp | 2 +- tests/inclusion/source/variadic_results.cpp | 2 +- tests/inclusion/source/version.cpp | 2 +- tests/inclusion/source/wrapper.cpp | 2 +- tests/lua_lifetime/CMakeLists.txt | 2 +- tests/numerics/CMakeLists.txt | 2 +- tests/numerics/source/large.cpp | 2 +- tests/numerics/source/main.cpp | 2 +- tests/regression_tests/1011/CMakeLists.txt | 2 +- tests/regression_tests/CMakeLists.txt | 2 +- tests/regression_tests/simple/CMakeLists.txt | 2 +- .../simple/source/1000 - readonly warning.cpp | 2 +- .../1008 - as_function binding triggers correctly.cpp | 2 +- .../simple/source/1067 - optional bindings.cpp | 2 +- .../simple/source/1072 - capture exception propagation.cpp | 2 +- .../source/1087 - readonly property error checking.cpp | 2 +- .../source/1095 - raw_get from global table fails.cpp | 2 +- .../simple/source/1096 - functions binding wrong.cpp | 2 +- .../1144 - type destructed from non-destructed memory.cpp | 2 +- ...1149 - static method gets const-morphed in internals.cpp | 2 +- .../source/1192 - incorrect alignment calculation.cpp | 2 +- .../source/1211 - protected_function_result nullptr.cpp | 2 +- .../1266 - add method in Lua 5.4 showing freelist.cpp | 2 +- .../simple/source/1315 - keep-alive memory.cpp | 2 +- tests/regression_tests/simple/source/main.cpp | 2 +- tests/run_time/CMakeLists.txt | 2 +- tests/run_time/source/basic.cpp | 2 +- tests/run_time/source/common_classes.hpp | 4 ++-- tests/run_time/source/container.usertype_check.cpp | 2 +- tests/run_time/source/container_semantics.cpp | 2 +- tests/run_time/source/container_semantics.custom.cpp | 2 +- tests/run_time/source/container_semantics.ordered.cpp | 2 +- tests/run_time/source/container_semantics.unordered.cpp | 2 +- tests/run_time/source/container_shims.cpp | 2 +- tests/run_time/source/container_table.cpp | 2 +- tests/run_time/source/containers.cpp | 2 +- tests/run_time/source/containers.roundtrip.cpp | 2 +- tests/run_time/source/containers.table.cpp | 2 +- tests/run_time/source/coroutines.cpp | 2 +- tests/run_time/source/customizations.cpp | 2 +- tests/run_time/source/customizations_private.cpp | 2 +- tests/run_time/source/dump.cpp | 2 +- tests/run_time/source/functions.cpp | 2 +- tests/run_time/source/functions.std.cpp | 2 +- tests/run_time/source/gc.cpp | 2 +- tests/run_time/source/lua_value.cpp | 2 +- tests/run_time/source/main.cpp | 2 +- tests/run_time/source/operators.cpp | 2 +- tests/run_time/source/overflow.cpp | 2 +- tests/run_time/source/plain_types.cpp | 2 +- tests/run_time/source/policies.cpp | 2 +- tests/run_time/source/proxies.cpp | 2 +- tests/run_time/source/sol_test.hpp | 2 +- tests/run_time/source/state.cpp | 2 +- tests/run_time/source/storage.cpp | 2 +- tests/run_time/source/strings.cpp | 2 +- tests/run_time/source/tables.checks.cpp | 2 +- tests/run_time/source/tables.clear.cpp | 2 +- tests/run_time/source/tables.cpp | 2 +- tests/run_time/source/tables.enums.cpp | 2 +- tests/run_time/source/tables.indexing.cpp | 2 +- tests/run_time/source/tables.insertion.cpp | 2 +- tests/run_time/source/tables.traversal.cpp | 2 +- tests/run_time/source/usertypes.auxiliary_keys.cpp | 2 +- tests/run_time/source/usertypes.basic.cpp | 2 +- tests/run_time/source/usertypes.constructors.cpp | 2 +- tests/run_time/source/usertypes.cpp | 2 +- tests/run_time/source/usertypes.inheritance.cpp | 2 +- tests/run_time/source/usertypes.inheritance.multi.cpp | 2 +- tests/run_time/source/usertypes.member_variables.cpp | 2 +- tests/run_time/source/usertypes.overload.cpp | 2 +- tests/run_time/source/usertypes.properties.cpp | 2 +- tests/run_time/source/usertypes.runtime.cpp | 2 +- tests/run_time/source/usertypes.unique.cpp | 2 +- tests/run_time/source/usertypes.unregister.cpp | 2 +- tests/run_time/source/utility.cpp | 2 +- tests/run_time/source/variadics.cpp | 2 +- 347 files changed, 359 insertions(+), 361 deletions(-) diff --git a/.clang-format b/.clang-format index cc98bcf3..f75a5542 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,7 @@ # # # # sol2 # 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/.dockerignore b/.dockerignore index c50cd66d..e64d3754 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,7 @@ # # # # sol2 # 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/.gitignore b/.gitignore index cd6d4567..4f42a72f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # # # # sol2 # 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 @@ -127,5 +127,5 @@ LuaJIT-2.0/ LuaJIT-2.1/ lua-5.1/ lua-5.2/ -~syncthing* -.tmp +~syncthing* +.tmp diff --git a/CMakeLists.txt b/CMakeLists.txt index 8608e19b..120dd38d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/LICENSE.txt b/LICENSE.txt index 633ce75b..dacba36c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ 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/cmake/Includes/Project.cmake b/cmake/Includes/Project.cmake index b121fdbe..e7c8d7a5 100644 --- a/cmake/Includes/Project.cmake +++ b/cmake/Includes/Project.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Modules/CheckCompilerDiagnostic.cmake b/cmake/Modules/CheckCompilerDiagnostic.cmake index 846dc01f..b5a81d28 100644 --- a/cmake/Modules/CheckCompilerDiagnostic.cmake +++ b/cmake/Modules/CheckCompilerDiagnostic.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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 @@ -89,4 +89,4 @@ function (check_compiler_diagnostic diagnostic) set(--allow-${diagnostic} $<${when}:${allow_prefix}${diagnostic_flag}> PARENT_SCOPE) set(--warn-${diagnostic} $<${when}:${warn_prefix}${diagnostic_flag}> PARENT_SCOPE) -endfunction() \ No newline at end of file +endfunction() diff --git a/cmake/Modules/CheckCompilerFlag.cmake b/cmake/Modules/CheckCompilerFlag.cmake index 0b919a73..e9fc198c 100644 --- a/cmake/Modules/CheckCompilerFlag.cmake +++ b/cmake/Modules/CheckCompilerFlag.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Modules/Common/Core.cmake b/cmake/Modules/Common/Core.cmake index ed9d95ed..77766e53 100644 --- a/cmake/Modules/Common/Core.cmake +++ b/cmake/Modules/Common/Core.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Modules/FindVersion.cmake b/cmake/Modules/FindVersion.cmake index c12a7f49..bfd342d7 100644 --- a/cmake/Modules/FindVersion.cmake +++ b/cmake/Modules/FindVersion.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Packages/FindKaguyaBuild.cmake b/cmake/Packages/FindKaguyaBuild.cmake index 0a6086a1..eb99c414 100644 --- a/cmake/Packages/FindKaguyaBuild.cmake +++ b/cmake/Packages/FindKaguyaBuild.cmake @@ -2,7 +2,7 @@ # # # # sol2 # 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 @@ -73,4 +73,4 @@ set(KAGUYA_INCLUDE_DIRS ${kaguya_include_dirs}) FIND_PACKAGE_HANDLE_STANDARD_ARGS(KaguyaBuild FOUND_VAR KAGUYABUILD_FOUND REQUIRED_VARS KAGUYA_LIBRARIES KAGUYA_INCLUDE_DIRS - VERSION_VAR kaguya_version) \ No newline at end of file + VERSION_VAR kaguya_version) diff --git a/cmake/Packages/FindLua/set_version_vars.cmake b/cmake/Packages/FindLua/set_version_vars.cmake index 5df75acd..1f64f9f3 100644 --- a/cmake/Packages/FindLua/set_version_vars.cmake +++ b/cmake/Packages/FindLua/set_version_vars.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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 @@ -74,4 +74,4 @@ function(_lua_set_version_vars _prefix _lua_suffix) set(_${_prefix}_include_subdirs "${_${_prefix}_include_subdirs}" PARENT_SCOPE) set(_${_prefix}_append_versions "${_${_prefix}_append_versions}" PARENT_SCOPE) set(_${_prefix}_library_names "${_${_prefix}_library_names}" PARENT_SCOPE) -endfunction(_lua_set_version_vars) \ No newline at end of file +endfunction(_lua_set_version_vars) diff --git a/cmake/Packages/FindLuaBridgeBuild.cmake b/cmake/Packages/FindLuaBridgeBuild.cmake index 7d3d92d0..b4534e23 100644 --- a/cmake/Packages/FindLuaBridgeBuild.cmake +++ b/cmake/Packages/FindLuaBridgeBuild.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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 @@ -72,5 +72,3 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuabridgeBuild FOUND_VAR LUABRIDGEBUILD_FOUND REQUIRED_VARS LUABRIDGE_LIBRARIES LUABRIDGE_INCLUDE_DIRS VERSION_VAR luabridge_version) - - diff --git a/cmake/Packages/FindLuaBuild.cmake b/cmake/Packages/FindLuaBuild.cmake index f59dad22..2668ef62 100644 --- a/cmake/Packages/FindLuaBuild.cmake +++ b/cmake/Packages/FindLuaBuild.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Packages/FindLuaBuild/LuaJIT.cmake b/cmake/Packages/FindLuaBuild/LuaJIT.cmake index 98001aa5..0683d818 100644 --- a/cmake/Packages/FindLuaBuild/LuaJIT.cmake +++ b/cmake/Packages/FindLuaBuild/LuaJIT.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Packages/FindLuaBuild/LuaVanilla.cmake b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake index f934b312..b95e5a67 100644 --- a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake +++ b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Packages/FindLuwraBuild.cmake b/cmake/Packages/FindLuwraBuild.cmake index d395f128..0315bb84 100644 --- a/cmake/Packages/FindLuwraBuild.cmake +++ b/cmake/Packages/FindLuwraBuild.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/Packages/FindSphinx.cmake b/cmake/Packages/FindSphinx.cmake index 55d83c3b..81b89f5c 100644 --- a/cmake/Packages/FindSphinx.cmake +++ b/cmake/Packages/FindSphinx.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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 @@ -65,4 +65,4 @@ if (Sphinx_Build_FOUND AND NOT TARGET Sphinx::Build) set_property(TARGET Sphinx::Build PROPERTY IMPORTED_LOCATION ${Sphinx_Build_EXECUTABLE}) set_property(TARGET Sphinx::Build PROPERTY VERSION ${Sphinx_Build_VERSION}) mark_as_advanced(Sphinx_Build_EXECUTABLE Sphinx_Build_VERSION) -endif() \ No newline at end of file +endif() diff --git a/cmake/Packages/FindToLuappBuild.cmake b/cmake/Packages/FindToLuappBuild.cmake index 92247c3f..be3f11ba 100644 --- a/cmake/Packages/FindToLuappBuild.cmake +++ b/cmake/Packages/FindToLuappBuild.cmake @@ -1,7 +1,7 @@ # # # # sol2 # 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/cmake/sol2-config.cmake.in b/cmake/sol2-config.cmake.in index 7bbabe2c..0c48a993 100644 --- a/cmake/sol2-config.cmake.in +++ b/cmake/sol2-config.cmake.in @@ -1,7 +1,7 @@ # # # # sol2 # 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/documentation/.clang-format b/documentation/.clang-format index a2c0dcaa..00ef7c2c 100644 --- a/documentation/.clang-format +++ b/documentation/.clang-format @@ -1,7 +1,7 @@ # # # # sol2 # 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/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index 04e7af51..8add0e93 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/documentation/Doxyfile.in b/documentation/Doxyfile.in index 1cfbc867..7f15d537 100644 --- a/documentation/Doxyfile.in +++ b/documentation/Doxyfile.in @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/.clang-format b/examples/.clang-format index adf570ac..9807f392 100644 --- a/examples/.clang-format +++ b/examples/.clang-format @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/CMakeLists.txt b/examples/CMakeLists.txt index 59f1caa6..e33c45b4 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/customization/CMakeLists.txt b/examples/customization/CMakeLists.txt index 38f7ff94..48f5f5b7 100644 --- a/examples/customization/CMakeLists.txt +++ b/examples/customization/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/interop/LuaBridge/CMakeLists.txt b/examples/interop/LuaBridge/CMakeLists.txt index 73aa9e9b..423ef625 100644 --- a/examples/interop/LuaBridge/CMakeLists.txt +++ b/examples/interop/LuaBridge/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/interop/kaguya/CMakeLists.txt b/examples/interop/kaguya/CMakeLists.txt index 7e99e8b6..a0b7b13c 100644 --- a/examples/interop/kaguya/CMakeLists.txt +++ b/examples/interop/kaguya/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/interop/luwra/CMakeLists.txt b/examples/interop/luwra/CMakeLists.txt index 9a5cdf71..bf9aaced 100644 --- a/examples/interop/luwra/CMakeLists.txt +++ b/examples/interop/luwra/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/interop/tolua/CMakeLists.txt b/examples/interop/tolua/CMakeLists.txt index 76a53c56..0b4c8125 100644 --- a/examples/interop/tolua/CMakeLists.txt +++ b/examples/interop/tolua/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/examples/require_dll_example/CMakeLists.txt b/examples/require_dll_example/CMakeLists.txt index 46981d1e..ddd40b25 100644 --- a/examples/require_dll_example/CMakeLists.txt +++ b/examples/require_dll_example/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/include/sol/as_args.hpp b/include/sol/as_args.hpp index 5afe78b0..719a3cdc 100644 --- a/include/sol/as_args.hpp +++ b/include/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/include/sol/as_returns.hpp b/include/sol/as_returns.hpp index 0ac499e6..982f408b 100644 --- a/include/sol/as_returns.hpp +++ b/include/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/include/sol/assert.hpp b/include/sol/assert.hpp index 7d4b732d..97fdfdbe 100644 --- a/include/sol/assert.hpp +++ b/include/sol/assert.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/include/sol/base_traits.hpp b/include/sol/base_traits.hpp index 9fae18e2..811e7992 100644 --- a/include/sol/base_traits.hpp +++ b/include/sol/base_traits.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/include/sol/bind_traits.hpp b/include/sol/bind_traits.hpp index ca46e474..a85bba61 100644 --- a/include/sol/bind_traits.hpp +++ b/include/sol/bind_traits.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/include/sol/bytecode.hpp b/include/sol/bytecode.hpp index 71a375ce..53891f7c 100644 --- a/include/sol/bytecode.hpp +++ b/include/sol/bytecode.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/include/sol/call.hpp b/include/sol/call.hpp index 7b932442..705b22f0 100644 --- a/include/sol/call.hpp +++ b/include/sol/call.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/include/sol/compatibility.hpp b/include/sol/compatibility.hpp index 6ed9be80..d7b4f9ce 100644 --- a/include/sol/compatibility.hpp +++ b/include/sol/compatibility.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/include/sol/compatibility/lua_version.hpp b/include/sol/compatibility/lua_version.hpp index 201fa6cc..b0bf1e45 100644 --- a/include/sol/compatibility/lua_version.hpp +++ b/include/sol/compatibility/lua_version.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/include/sol/config.hpp b/include/sol/config.hpp index fd2a228d..e341ba19 100644 --- a/include/sol/config.hpp +++ b/include/sol/config.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/include/sol/coroutine.hpp b/include/sol/coroutine.hpp index 7482060e..1698eb91 100644 --- a/include/sol/coroutine.hpp +++ b/include/sol/coroutine.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/include/sol/debug.hpp b/include/sol/debug.hpp index 477b00ff..8a139a27 100644 --- a/include/sol/debug.hpp +++ b/include/sol/debug.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/include/sol/demangle.hpp b/include/sol/demangle.hpp index 4713855f..f1bb665c 100644 --- a/include/sol/demangle.hpp +++ b/include/sol/demangle.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/include/sol/deprecate.hpp b/include/sol/deprecate.hpp index 7fbb0308..700f0531 100644 --- a/include/sol/deprecate.hpp +++ b/include/sol/deprecate.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/include/sol/detail/build_version.hpp b/include/sol/detail/build_version.hpp index e5de601f..3f9c6931 100644 --- a/include/sol/detail/build_version.hpp +++ b/include/sol/detail/build_version.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/include/sol/dump_handler.hpp b/include/sol/dump_handler.hpp index 966255e5..dc6c51d0 100644 --- a/include/sol/dump_handler.hpp +++ b/include/sol/dump_handler.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/include/sol/ebco.hpp b/include/sol/ebco.hpp index 6fbeaf3f..133dc6f8 100644 --- a/include/sol/ebco.hpp +++ b/include/sol/ebco.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/include/sol/environment.hpp b/include/sol/environment.hpp index 84c44ac4..a41f3822 100644 --- a/include/sol/environment.hpp +++ b/include/sol/environment.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/include/sol/epilogue.hpp b/include/sol/epilogue.hpp index d6b32a3a..95afcb9f 100644 --- a/include/sol/epilogue.hpp +++ b/include/sol/epilogue.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/include/sol/error.hpp b/include/sol/error.hpp index 99d2a425..8a59df62 100644 --- a/include/sol/error.hpp +++ b/include/sol/error.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/include/sol/error_handler.hpp b/include/sol/error_handler.hpp index 1e242386..20a5aa1e 100644 --- a/include/sol/error_handler.hpp +++ b/include/sol/error_handler.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/include/sol/forward.hpp b/include/sol/forward.hpp index 16cc2e10..7713b764 100644 --- a/include/sol/forward.hpp +++ b/include/sol/forward.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/include/sol/forward_detail.hpp b/include/sol/forward_detail.hpp index 72c3f76c..1792d1a4 100644 --- a/include/sol/forward_detail.hpp +++ b/include/sol/forward_detail.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/include/sol/function.hpp b/include/sol/function.hpp index 7afeb6c1..ed1f5c22 100644 --- a/include/sol/function.hpp +++ b/include/sol/function.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/include/sol/function_result.hpp b/include/sol/function_result.hpp index 1f998d7f..5026ec50 100644 --- a/include/sol/function_result.hpp +++ b/include/sol/function_result.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/include/sol/function_types.hpp b/include/sol/function_types.hpp index 87707d7e..27cd6bc7 100644 --- a/include/sol/function_types.hpp +++ b/include/sol/function_types.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/include/sol/function_types_core.hpp b/include/sol/function_types_core.hpp index 138b2b51..6cec2152 100644 --- a/include/sol/function_types_core.hpp +++ b/include/sol/function_types_core.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/include/sol/function_types_overloaded.hpp b/include/sol/function_types_overloaded.hpp index 8c8e5c1a..63044b7d 100644 --- a/include/sol/function_types_overloaded.hpp +++ b/include/sol/function_types_overloaded.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 @@ -62,4 +62,4 @@ namespace sol { namespace function_detail { }; }} // namespace sol::function_detail -#endif // SOL_FUNCTION_TYPES_OVERLOAD_HPP \ No newline at end of file +#endif // SOL_FUNCTION_TYPES_OVERLOAD_HPP diff --git a/include/sol/function_types_stateful.hpp b/include/sol/function_types_stateful.hpp index 2f777aaa..9a5ca300 100644 --- a/include/sol/function_types_stateful.hpp +++ b/include/sol/function_types_stateful.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/include/sol/function_types_stateless.hpp b/include/sol/function_types_stateless.hpp index b54d6c0e..a2f66ba0 100644 --- a/include/sol/function_types_stateless.hpp +++ b/include/sol/function_types_stateless.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/include/sol/function_types_templated.hpp b/include/sol/function_types_templated.hpp index 36ef72d1..1cc82d6e 100644 --- a/include/sol/function_types_templated.hpp +++ b/include/sol/function_types_templated.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/include/sol/in_place.hpp b/include/sol/in_place.hpp index 69716296..2732472e 100644 --- a/include/sol/in_place.hpp +++ b/include/sol/in_place.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/include/sol/inheritance.hpp b/include/sol/inheritance.hpp index 88ba6fa8..3e47c468 100644 --- a/include/sol/inheritance.hpp +++ b/include/sol/inheritance.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/include/sol/load_result.hpp b/include/sol/load_result.hpp index 07c119f8..0496656d 100644 --- a/include/sol/load_result.hpp +++ b/include/sol/load_result.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/include/sol/lua_table.hpp b/include/sol/lua_table.hpp index 1dc4a543..ce7bdce3 100644 --- a/include/sol/lua_table.hpp +++ b/include/sol/lua_table.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/include/sol/lua_value.hpp b/include/sol/lua_value.hpp index e4f6d1e8..25f9bcd6 100644 --- a/include/sol/lua_value.hpp +++ b/include/sol/lua_value.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/include/sol/make_reference.hpp b/include/sol/make_reference.hpp index 6b13b1ea..8e6b6ecd 100644 --- a/include/sol/make_reference.hpp +++ b/include/sol/make_reference.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/include/sol/metatable.hpp b/include/sol/metatable.hpp index a75b48be..b1b90fd7 100644 --- a/include/sol/metatable.hpp +++ b/include/sol/metatable.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/include/sol/object.hpp b/include/sol/object.hpp index da39b9f0..991f7114 100644 --- a/include/sol/object.hpp +++ b/include/sol/object.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/include/sol/object_base.hpp b/include/sol/object_base.hpp index ea9b9be1..7164f16b 100644 --- a/include/sol/object_base.hpp +++ b/include/sol/object_base.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/include/sol/optional.hpp b/include/sol/optional.hpp index a0f1ba26..0c46d8bd 100644 --- a/include/sol/optional.hpp +++ b/include/sol/optional.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/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp index 03afd8c1..26f41d0c 100644 --- a/include/sol/optional_implementation.hpp +++ b/include/sol/optional_implementation.hpp @@ -1,6 +1,6 @@ // 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/include/sol/overload.hpp b/include/sol/overload.hpp index 74b7bcf6..03d73e42 100644 --- a/include/sol/overload.hpp +++ b/include/sol/overload.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 @@ -46,4 +46,4 @@ namespace sol { } } // namespace sol -#endif // SOL_OVERLOAD_HPP \ No newline at end of file +#endif // SOL_OVERLOAD_HPP diff --git a/include/sol/packaged_coroutine.hpp b/include/sol/packaged_coroutine.hpp index 642c6208..d8b3709c 100644 --- a/include/sol/packaged_coroutine.hpp +++ b/include/sol/packaged_coroutine.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/include/sol/pairs_iterator.hpp b/include/sol/pairs_iterator.hpp index b68c18de..147a3899 100644 --- a/include/sol/pairs_iterator.hpp +++ b/include/sol/pairs_iterator.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/include/sol/pointer_like.hpp b/include/sol/pointer_like.hpp index 0a3884c6..03f35ae3 100644 --- a/include/sol/pointer_like.hpp +++ b/include/sol/pointer_like.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/include/sol/policies.hpp b/include/sol/policies.hpp index 90789b78..d373bb89 100644 --- a/include/sol/policies.hpp +++ b/include/sol/policies.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/include/sol/prologue.hpp b/include/sol/prologue.hpp index 0c9fec3f..179822e2 100644 --- a/include/sol/prologue.hpp +++ b/include/sol/prologue.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/include/sol/property.hpp b/include/sol/property.hpp index 8b818daf..c69fd025 100644 --- a/include/sol/property.hpp +++ b/include/sol/property.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/include/sol/protect.hpp b/include/sol/protect.hpp index 8b1221df..932ffb70 100644 --- a/include/sol/protect.hpp +++ b/include/sol/protect.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/include/sol/protected_function.hpp b/include/sol/protected_function.hpp index 9b4298c0..8a2e0ec3 100644 --- a/include/sol/protected_function.hpp +++ b/include/sol/protected_function.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/include/sol/protected_function_result.hpp b/include/sol/protected_function_result.hpp index 5859a7ae..4d53ce04 100644 --- a/include/sol/protected_function_result.hpp +++ b/include/sol/protected_function_result.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/include/sol/protected_handler.hpp b/include/sol/protected_handler.hpp index 6f1bd744..c42f8875 100644 --- a/include/sol/protected_handler.hpp +++ b/include/sol/protected_handler.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/include/sol/proxy_base.hpp b/include/sol/proxy_base.hpp index bae2000d..c473554a 100644 --- a/include/sol/proxy_base.hpp +++ b/include/sol/proxy_base.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/include/sol/raii.hpp b/include/sol/raii.hpp index 10cbb28c..629022b4 100644 --- a/include/sol/raii.hpp +++ b/include/sol/raii.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/include/sol/reference.hpp b/include/sol/reference.hpp index 39c538ef..c7781552 100644 --- a/include/sol/reference.hpp +++ b/include/sol/reference.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/include/sol/resolve.hpp b/include/sol/resolve.hpp index 2cbc8d2f..513af967 100644 --- a/include/sol/resolve.hpp +++ b/include/sol/resolve.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/include/sol/sol.hpp b/include/sol/sol.hpp index f492ed98..1a2a4b99 100644 --- a/include/sol/sol.hpp +++ b/include/sol/sol.hpp @@ -1,6 +1,6 @@ // 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/include/sol/stack.hpp b/include/sol/stack.hpp index 90e84598..f35b1549 100644 --- a/include/sol/stack.hpp +++ b/include/sol/stack.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/include/sol/stack/detail/pairs.hpp b/include/sol/stack/detail/pairs.hpp index e6e3670d..c913a748 100644 --- a/include/sol/stack/detail/pairs.hpp +++ b/include/sol/stack/detail/pairs.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/include/sol/stack_check.hpp b/include/sol/stack_check.hpp index b90d70e7..b4389e22 100644 --- a/include/sol/stack_check.hpp +++ b/include/sol/stack_check.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/include/sol/stack_check_get.hpp b/include/sol/stack_check_get.hpp index 9353c3c7..c20c6584 100644 --- a/include/sol/stack_check_get.hpp +++ b/include/sol/stack_check_get.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/include/sol/stack_check_get_qualified.hpp b/include/sol/stack_check_get_qualified.hpp index 102e213e..60825033 100644 --- a/include/sol/stack_check_get_qualified.hpp +++ b/include/sol/stack_check_get_qualified.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/include/sol/stack_check_get_unqualified.hpp b/include/sol/stack_check_get_unqualified.hpp index 96ad2fab..645c0a4d 100644 --- a/include/sol/stack_check_get_unqualified.hpp +++ b/include/sol/stack_check_get_unqualified.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/include/sol/stack_check_qualified.hpp b/include/sol/stack_check_qualified.hpp index 5712a168..cc2394af 100644 --- a/include/sol/stack_check_qualified.hpp +++ b/include/sol/stack_check_qualified.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/include/sol/stack_check_unqualified.hpp b/include/sol/stack_check_unqualified.hpp index 48ae6727..4bf75626 100644 --- a/include/sol/stack_check_unqualified.hpp +++ b/include/sol/stack_check_unqualified.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/include/sol/stack_core.hpp b/include/sol/stack_core.hpp index 4feca049..a037c5b8 100644 --- a/include/sol/stack_core.hpp +++ b/include/sol/stack_core.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/include/sol/stack_field.hpp b/include/sol/stack_field.hpp index a0ef28f8..9dd66e2e 100644 --- a/include/sol/stack_field.hpp +++ b/include/sol/stack_field.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/include/sol/stack_get.hpp b/include/sol/stack_get.hpp index 70e8c699..5b9c9f7f 100644 --- a/include/sol/stack_get.hpp +++ b/include/sol/stack_get.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/include/sol/stack_get_qualified.hpp b/include/sol/stack_get_qualified.hpp index a71c2959..c8f50300 100644 --- a/include/sol/stack_get_qualified.hpp +++ b/include/sol/stack_get_qualified.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/include/sol/stack_get_unqualified.hpp b/include/sol/stack_get_unqualified.hpp index 1764089a..d8d5a122 100644 --- a/include/sol/stack_get_unqualified.hpp +++ b/include/sol/stack_get_unqualified.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/include/sol/stack_guard.hpp b/include/sol/stack_guard.hpp index 6979e9c1..ce78ca87 100644 --- a/include/sol/stack_guard.hpp +++ b/include/sol/stack_guard.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/include/sol/stack_iterator.hpp b/include/sol/stack_iterator.hpp index e73a4df2..d152be2a 100644 --- a/include/sol/stack_iterator.hpp +++ b/include/sol/stack_iterator.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/include/sol/stack_pop.hpp b/include/sol/stack_pop.hpp index 065908fc..5ef03373 100644 --- a/include/sol/stack_pop.hpp +++ b/include/sol/stack_pop.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/include/sol/stack_probe.hpp b/include/sol/stack_probe.hpp index 3b971621..d590a3d0 100644 --- a/include/sol/stack_probe.hpp +++ b/include/sol/stack_probe.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 @@ -91,4 +91,4 @@ namespace sol { namespace stack { }; }} // namespace sol::stack -#endif // SOL_STACK_PROBE_HPP \ No newline at end of file +#endif // SOL_STACK_PROBE_HPP diff --git a/include/sol/stack_proxy.hpp b/include/sol/stack_proxy.hpp index 169efd00..8aa2b24c 100644 --- a/include/sol/stack_proxy.hpp +++ b/include/sol/stack_proxy.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/include/sol/stack_proxy_base.hpp b/include/sol/stack_proxy_base.hpp index 75c6e781..68f01d55 100644 --- a/include/sol/stack_proxy_base.hpp +++ b/include/sol/stack_proxy_base.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/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 80de5b72..8036896e 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.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/include/sol/stack_reference.hpp b/include/sol/stack_reference.hpp index 55861879..d3a2ac58 100644 --- a/include/sol/stack_reference.hpp +++ b/include/sol/stack_reference.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/include/sol/state.hpp b/include/sol/state.hpp index 1f0f0bc4..ed2412ed 100644 --- a/include/sol/state.hpp +++ b/include/sol/state.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/include/sol/state_handling.hpp b/include/sol/state_handling.hpp index e6b97d52..c3efe6c7 100644 --- a/include/sol/state_handling.hpp +++ b/include/sol/state_handling.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/include/sol/state_view.hpp b/include/sol/state_view.hpp index 06983729..fe736d13 100644 --- a/include/sol/state_view.hpp +++ b/include/sol/state_view.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/include/sol/string_view.hpp b/include/sol/string_view.hpp index 19f89f53..5d145cc5 100644 --- a/include/sol/string_view.hpp +++ b/include/sol/string_view.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/include/sol/table.hpp b/include/sol/table.hpp index fd0b0ea0..9a2f5385 100644 --- a/include/sol/table.hpp +++ b/include/sol/table.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/include/sol/table_core.hpp b/include/sol/table_core.hpp index 21080baa..7b8eb353 100644 --- a/include/sol/table_core.hpp +++ b/include/sol/table_core.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/include/sol/table_iterator.hpp b/include/sol/table_iterator.hpp index 8cf6f075..3a0127cf 100644 --- a/include/sol/table_iterator.hpp +++ b/include/sol/table_iterator.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/include/sol/table_proxy.hpp b/include/sol/table_proxy.hpp index 504b244c..1cb1e9de 100644 --- a/include/sol/table_proxy.hpp +++ b/include/sol/table_proxy.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/include/sol/thread.hpp b/include/sol/thread.hpp index 46357750..44367f19 100644 --- a/include/sol/thread.hpp +++ b/include/sol/thread.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/include/sol/tie.hpp b/include/sol/tie.hpp index 6f6b7dc4..41db45f8 100644 --- a/include/sol/tie.hpp +++ b/include/sol/tie.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/include/sol/traits.hpp b/include/sol/traits.hpp index b95ecb96..d472d811 100644 --- a/include/sol/traits.hpp +++ b/include/sol/traits.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/include/sol/trampoline.hpp b/include/sol/trampoline.hpp index d6bf90c9..2a1943ec 100644 --- a/include/sol/trampoline.hpp +++ b/include/sol/trampoline.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/include/sol/tuple.hpp b/include/sol/tuple.hpp index 3ec1e16f..c65dc9d6 100644 --- a/include/sol/tuple.hpp +++ b/include/sol/tuple.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/include/sol/types.hpp b/include/sol/types.hpp index e6cc143c..d54523d4 100644 --- a/include/sol/types.hpp +++ b/include/sol/types.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/include/sol/unique_usertype_traits.hpp b/include/sol/unique_usertype_traits.hpp index d383dc96..33333161 100644 --- a/include/sol/unique_usertype_traits.hpp +++ b/include/sol/unique_usertype_traits.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/include/sol/unsafe_function.hpp b/include/sol/unsafe_function.hpp index 9109d6ba..8d7a6a65 100644 --- a/include/sol/unsafe_function.hpp +++ b/include/sol/unsafe_function.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/include/sol/unsafe_function_result.hpp b/include/sol/unsafe_function_result.hpp index c5e976ff..13496819 100644 --- a/include/sol/unsafe_function_result.hpp +++ b/include/sol/unsafe_function_result.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/include/sol/userdata.hpp b/include/sol/userdata.hpp index a4fedefc..29efdcbf 100644 --- a/include/sol/userdata.hpp +++ b/include/sol/userdata.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/include/sol/usertype.hpp b/include/sol/usertype.hpp index b37436ad..7c356f00 100644 --- a/include/sol/usertype.hpp +++ b/include/sol/usertype.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/include/sol/usertype_container.hpp b/include/sol/usertype_container.hpp index 5846493b..198ec89c 100644 --- a/include/sol/usertype_container.hpp +++ b/include/sol/usertype_container.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/include/sol/usertype_container_launch.hpp b/include/sol/usertype_container_launch.hpp index e25f4a7e..d8dd73a7 100644 --- a/include/sol/usertype_container_launch.hpp +++ b/include/sol/usertype_container_launch.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/include/sol/usertype_core.hpp b/include/sol/usertype_core.hpp index 98ed1eae..e4a49127 100644 --- a/include/sol/usertype_core.hpp +++ b/include/sol/usertype_core.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/include/sol/usertype_proxy.hpp b/include/sol/usertype_proxy.hpp index 2d36ef44..b900d650 100644 --- a/include/sol/usertype_proxy.hpp +++ b/include/sol/usertype_proxy.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/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index 9450367a..bdca6146 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.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/include/sol/usertype_traits.hpp b/include/sol/usertype_traits.hpp index cf60b274..c9a4d6e7 100644 --- a/include/sol/usertype_traits.hpp +++ b/include/sol/usertype_traits.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/include/sol/variadic_args.hpp b/include/sol/variadic_args.hpp index efaad38d..216c27b4 100644 --- a/include/sol/variadic_args.hpp +++ b/include/sol/variadic_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/include/sol/variadic_results.hpp b/include/sol/variadic_results.hpp index 6b8e981c..adf43a46 100644 --- a/include/sol/variadic_results.hpp +++ b/include/sol/variadic_results.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/include/sol/version.hpp b/include/sol/version.hpp index 93afc9d5..ae002e1d 100644 --- a/include/sol/version.hpp +++ b/include/sol/version.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/include/sol/wrapper.hpp b/include/sol/wrapper.hpp index 6d33e71e..4b4b466e 100644 --- a/include/sol/wrapper.hpp +++ b/include/sol/wrapper.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/scripts/build.linux.sh b/scripts/build.linux.sh index 6f7c879c..73814bea 100644 --- a/scripts/build.linux.sh +++ b/scripts/build.linux.sh @@ -3,7 +3,7 @@ # # # # sol2 # 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/scripts/preparation.linux.sh b/scripts/preparation.linux.sh index d009160e..762c921f 100644 --- a/scripts/preparation.linux.sh +++ b/scripts/preparation.linux.sh @@ -3,7 +3,7 @@ # # # # sol2 # 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/scripts/preparation.osx.sh b/scripts/preparation.osx.sh index d2dc2656..be2831e4 100644 --- a/scripts/preparation.osx.sh +++ b/scripts/preparation.osx.sh @@ -3,7 +3,7 @@ # # # # sol2 # 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/scripts/push.linux.sh b/scripts/push.linux.sh index 0743fc76..a1872f35 100644 --- a/scripts/push.linux.sh +++ b/scripts/push.linux.sh @@ -3,7 +3,7 @@ # # # # sol2 # 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/scripts/run.linux.sh b/scripts/run.linux.sh index 6397bf66..fb1b79fc 100644 --- a/scripts/run.linux.sh +++ b/scripts/run.linux.sh @@ -3,7 +3,7 @@ # # # # sol2 # 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/scripts/run.osx.sh b/scripts/run.osx.sh index 09ccb488..218966dd 100644 --- a/scripts/run.osx.sh +++ b/scripts/run.osx.sh @@ -3,7 +3,7 @@ # # # # sol2 # 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/tests/CMakeLists.txt b/tests/CMakeLists.txt index e25ae3ca..f727763b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/config_tests/CMakeLists.txt b/tests/config_tests/CMakeLists.txt index 89bc64cc..4590fd2d 100644 --- a/tests/config_tests/CMakeLists.txt +++ b/tests/config_tests/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/config_tests/function_pointers/CMakeLists.txt b/tests/config_tests/function_pointers/CMakeLists.txt index cd3b4258..a013816a 100644 --- a/tests/config_tests/function_pointers/CMakeLists.txt +++ b/tests/config_tests/function_pointers/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/config_tests/function_pointers/source/main.cpp b/tests/config_tests/function_pointers/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/config_tests/function_pointers/source/main.cpp +++ b/tests/config_tests/function_pointers/source/main.cpp @@ -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/tests/config_tests/function_pointers/source/retrieval.cpp b/tests/config_tests/function_pointers/source/retrieval.cpp index 8a1b6dae..437218b9 100644 --- a/tests/config_tests/function_pointers/source/retrieval.cpp +++ b/tests/config_tests/function_pointers/source/retrieval.cpp @@ -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/tests/config_tests/integer_value_fits/CMakeLists.txt b/tests/config_tests/integer_value_fits/CMakeLists.txt index e889b3b7..3ddfee87 100644 --- a/tests/config_tests/integer_value_fits/CMakeLists.txt +++ b/tests/config_tests/integer_value_fits/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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 @@ -37,4 +37,4 @@ if (SOL2_TESTS_SINGLE) sol2_create_basic_test(sol2.single.tests.config.integer_value_fits sol2::sol2 ${sources}) target_compile_definitions(sol2.single.tests.config.integer_value_fits PRIVATE SOL_ALL_INTEGER_VALUES_FIT=1) -endif() \ No newline at end of file +endif() diff --git a/tests/config_tests/integer_value_fits/source/main.cpp b/tests/config_tests/integer_value_fits/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/config_tests/integer_value_fits/source/main.cpp +++ b/tests/config_tests/integer_value_fits/source/main.cpp @@ -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/tests/config_tests/integer_value_fits/source/negative_size_t.cpp b/tests/config_tests/integer_value_fits/source/negative_size_t.cpp index 361074f0..40c5f9e5 100644 --- a/tests/config_tests/integer_value_fits/source/negative_size_t.cpp +++ b/tests/config_tests/integer_value_fits/source/negative_size_t.cpp @@ -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/tests/enum/CMakeLists.txt b/tests/enum/CMakeLists.txt index cb21645c..8584fbff 100644 --- a/tests/enum/CMakeLists.txt +++ b/tests/enum/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/enum/source/main.cpp b/tests/enum/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/enum/source/main.cpp +++ b/tests/enum/source/main.cpp @@ -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/tests/enum/source/read_only_iteration.cpp b/tests/enum/source/read_only_iteration.cpp index cab8bb3a..5494be1c 100644 --- a/tests/enum/source/read_only_iteration.cpp +++ b/tests/enum/source/read_only_iteration.cpp @@ -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/tests/environment/CMakeLists.txt b/tests/environment/CMakeLists.txt index 3ece2ab4..b095caef 100644 --- a/tests/environment/CMakeLists.txt +++ b/tests/environment/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/environment/source/get.cpp b/tests/environment/source/get.cpp index 36b446ad..768b1b91 100644 --- a/tests/environment/source/get.cpp +++ b/tests/environment/source/get.cpp @@ -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/tests/environment/source/main.cpp b/tests/environment/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/environment/source/main.cpp +++ b/tests/environment/source/main.cpp @@ -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/tests/environment/source/sandboxing.cpp b/tests/environment/source/sandboxing.cpp index e6688efe..d5233f1e 100644 --- a/tests/environment/source/sandboxing.cpp +++ b/tests/environment/source/sandboxing.cpp @@ -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/tests/environment/source/shadowing.cpp b/tests/environment/source/shadowing.cpp index 8e86427a..55547e45 100644 --- a/tests/environment/source/shadowing.cpp +++ b/tests/environment/source/shadowing.cpp @@ -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/tests/environment/source/this_environment.cpp b/tests/environment/source/this_environment.cpp index 4fe5c0b9..df8e187b 100644 --- a/tests/environment/source/this_environment.cpp +++ b/tests/environment/source/this_environment.cpp @@ -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/tests/exceptions/CMakeLists.txt b/tests/exceptions/CMakeLists.txt index 87f4c4d6..df7117da 100644 --- a/tests/exceptions/CMakeLists.txt +++ b/tests/exceptions/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/exceptions/source/functions.cpp b/tests/exceptions/source/functions.cpp index 1ee409ad..a90cc24f 100644 --- a/tests/exceptions/source/functions.cpp +++ b/tests/exceptions/source/functions.cpp @@ -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/tests/exceptions/source/functions.noexcept.cpp b/tests/exceptions/source/functions.noexcept.cpp index d051596a..f0c80f81 100644 --- a/tests/exceptions/source/functions.noexcept.cpp +++ b/tests/exceptions/source/functions.noexcept.cpp @@ -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/tests/exceptions/source/functions.yielding.cpp b/tests/exceptions/source/functions.yielding.cpp index 9160e3cf..cc3f3ee0 100644 --- a/tests/exceptions/source/functions.yielding.cpp +++ b/tests/exceptions/source/functions.yielding.cpp @@ -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/tests/exceptions/source/main.cpp b/tests/exceptions/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/exceptions/source/main.cpp +++ b/tests/exceptions/source/main.cpp @@ -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/tests/exceptions/source/usertypes.cpp b/tests/exceptions/source/usertypes.cpp index 4fe4f616..71bbb48d 100644 --- a/tests/exceptions/source/usertypes.cpp +++ b/tests/exceptions/source/usertypes.cpp @@ -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/tests/exceptions/source/usertypes.yielding.cpp b/tests/exceptions/source/usertypes.yielding.cpp index 5257c7d6..df09fc1b 100644 --- a/tests/exceptions/source/usertypes.yielding.cpp +++ b/tests/exceptions/source/usertypes.yielding.cpp @@ -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/tests/inclusion/CMakeLists.txt b/tests/inclusion/CMakeLists.txt index 23288461..d348e9fc 100644 --- a/tests/inclusion/CMakeLists.txt +++ b/tests/inclusion/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/inclusion/source/as_args.cpp b/tests/inclusion/source/as_args.cpp index e09c923a..c0115538 100644 --- a/tests/inclusion/source/as_args.cpp +++ b/tests/inclusion/source/as_args.cpp @@ -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/tests/inclusion/source/as_returns.cpp b/tests/inclusion/source/as_returns.cpp index cb68dd95..71d3d495 100644 --- a/tests/inclusion/source/as_returns.cpp +++ b/tests/inclusion/source/as_returns.cpp @@ -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/tests/inclusion/source/base_traits.cpp b/tests/inclusion/source/base_traits.cpp index 13eef577..47c5f4bb 100644 --- a/tests/inclusion/source/base_traits.cpp +++ b/tests/inclusion/source/base_traits.cpp @@ -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/tests/inclusion/source/bind_traits.cpp b/tests/inclusion/source/bind_traits.cpp index f3a72d83..c406c797 100644 --- a/tests/inclusion/source/bind_traits.cpp +++ b/tests/inclusion/source/bind_traits.cpp @@ -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/tests/inclusion/source/bytecode.cpp b/tests/inclusion/source/bytecode.cpp index 845921f5..9f941a99 100644 --- a/tests/inclusion/source/bytecode.cpp +++ b/tests/inclusion/source/bytecode.cpp @@ -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/tests/inclusion/source/call.cpp b/tests/inclusion/source/call.cpp index 30b15d43..c510e923 100644 --- a/tests/inclusion/source/call.cpp +++ b/tests/inclusion/source/call.cpp @@ -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/tests/inclusion/source/compatibility.cpp b/tests/inclusion/source/compatibility.cpp index e127e7ee..c45b223c 100644 --- a/tests/inclusion/source/compatibility.cpp +++ b/tests/inclusion/source/compatibility.cpp @@ -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/tests/inclusion/source/compatibility/compat-5.3.cpp b/tests/inclusion/source/compatibility/compat-5.3.cpp index 450460f9..adf66f59 100644 --- a/tests/inclusion/source/compatibility/compat-5.3.cpp +++ b/tests/inclusion/source/compatibility/compat-5.3.cpp @@ -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/tests/inclusion/source/compatibility/lua_version.cpp b/tests/inclusion/source/compatibility/lua_version.cpp index 0b6e9c6b..e2b58153 100644 --- a/tests/inclusion/source/compatibility/lua_version.cpp +++ b/tests/inclusion/source/compatibility/lua_version.cpp @@ -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/tests/inclusion/source/config.cpp b/tests/inclusion/source/config.cpp index e8c43aa2..4518ebb1 100644 --- a/tests/inclusion/source/config.cpp +++ b/tests/inclusion/source/config.cpp @@ -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/tests/inclusion/source/coroutine.cpp b/tests/inclusion/source/coroutine.cpp index 189ab29a..c60f7704 100644 --- a/tests/inclusion/source/coroutine.cpp +++ b/tests/inclusion/source/coroutine.cpp @@ -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/tests/inclusion/source/debug.cpp b/tests/inclusion/source/debug.cpp index 5e32a961..823abf52 100644 --- a/tests/inclusion/source/debug.cpp +++ b/tests/inclusion/source/debug.cpp @@ -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/tests/inclusion/source/demangle.cpp b/tests/inclusion/source/demangle.cpp index dbd41d96..9d9da7dc 100644 --- a/tests/inclusion/source/demangle.cpp +++ b/tests/inclusion/source/demangle.cpp @@ -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/tests/inclusion/source/deprecate.cpp b/tests/inclusion/source/deprecate.cpp index 6c6f24fb..8a045d9d 100644 --- a/tests/inclusion/source/deprecate.cpp +++ b/tests/inclusion/source/deprecate.cpp @@ -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/tests/inclusion/source/detail/build_version.cpp b/tests/inclusion/source/detail/build_version.cpp index b5553775..58592fc3 100644 --- a/tests/inclusion/source/detail/build_version.cpp +++ b/tests/inclusion/source/detail/build_version.cpp @@ -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/tests/inclusion/source/ebco.cpp b/tests/inclusion/source/ebco.cpp index 968f4d9e..6afe58c3 100644 --- a/tests/inclusion/source/ebco.cpp +++ b/tests/inclusion/source/ebco.cpp @@ -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/tests/inclusion/source/environment.cpp b/tests/inclusion/source/environment.cpp index 2d078f30..8344e12e 100644 --- a/tests/inclusion/source/environment.cpp +++ b/tests/inclusion/source/environment.cpp @@ -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/tests/inclusion/source/error_handler.cpp b/tests/inclusion/source/error_handler.cpp index c86fb5ee..c8b332fe 100644 --- a/tests/inclusion/source/error_handler.cpp +++ b/tests/inclusion/source/error_handler.cpp @@ -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/tests/inclusion/source/forward.cpp b/tests/inclusion/source/forward.cpp index ae8bc722..cf67b3b7 100644 --- a/tests/inclusion/source/forward.cpp +++ b/tests/inclusion/source/forward.cpp @@ -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/tests/inclusion/source/forward_detail.cpp b/tests/inclusion/source/forward_detail.cpp index 55e361e4..601ce94c 100644 --- a/tests/inclusion/source/forward_detail.cpp +++ b/tests/inclusion/source/forward_detail.cpp @@ -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/tests/inclusion/source/function.cpp b/tests/inclusion/source/function.cpp index 555dc8b1..5e79edd7 100644 --- a/tests/inclusion/source/function.cpp +++ b/tests/inclusion/source/function.cpp @@ -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/tests/inclusion/source/function_result.cpp b/tests/inclusion/source/function_result.cpp index d566c691..a869bad0 100644 --- a/tests/inclusion/source/function_result.cpp +++ b/tests/inclusion/source/function_result.cpp @@ -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/tests/inclusion/source/function_types.cpp b/tests/inclusion/source/function_types.cpp index cc81c3ae..5fae350b 100644 --- a/tests/inclusion/source/function_types.cpp +++ b/tests/inclusion/source/function_types.cpp @@ -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/tests/inclusion/source/function_types_core.cpp b/tests/inclusion/source/function_types_core.cpp index 1129eb48..86590b32 100644 --- a/tests/inclusion/source/function_types_core.cpp +++ b/tests/inclusion/source/function_types_core.cpp @@ -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/tests/inclusion/source/function_types_overloaded.cpp b/tests/inclusion/source/function_types_overloaded.cpp index 297f03b7..b698e2b1 100644 --- a/tests/inclusion/source/function_types_overloaded.cpp +++ b/tests/inclusion/source/function_types_overloaded.cpp @@ -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/tests/inclusion/source/function_types_stateful.cpp b/tests/inclusion/source/function_types_stateful.cpp index 27c4b168..23086c6a 100644 --- a/tests/inclusion/source/function_types_stateful.cpp +++ b/tests/inclusion/source/function_types_stateful.cpp @@ -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/tests/inclusion/source/function_types_stateless.cpp b/tests/inclusion/source/function_types_stateless.cpp index 9c9d7ee0..e7d9ae7c 100644 --- a/tests/inclusion/source/function_types_stateless.cpp +++ b/tests/inclusion/source/function_types_stateless.cpp @@ -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/tests/inclusion/source/function_types_templated.cpp b/tests/inclusion/source/function_types_templated.cpp index 9ed26da3..b6f73f3b 100644 --- a/tests/inclusion/source/function_types_templated.cpp +++ b/tests/inclusion/source/function_types_templated.cpp @@ -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/tests/inclusion/source/in_place.cpp b/tests/inclusion/source/in_place.cpp index 09c0d8ba..98d161b7 100644 --- a/tests/inclusion/source/in_place.cpp +++ b/tests/inclusion/source/in_place.cpp @@ -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/tests/inclusion/source/inheritance.cpp b/tests/inclusion/source/inheritance.cpp index 35839b54..38bcd1b5 100644 --- a/tests/inclusion/source/inheritance.cpp +++ b/tests/inclusion/source/inheritance.cpp @@ -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/tests/inclusion/source/load_result.cpp b/tests/inclusion/source/load_result.cpp index c9621afa..33bc4f14 100644 --- a/tests/inclusion/source/load_result.cpp +++ b/tests/inclusion/source/load_result.cpp @@ -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/tests/inclusion/source/lua_table.cpp b/tests/inclusion/source/lua_table.cpp index 87d4d517..4d38c5e8 100644 --- a/tests/inclusion/source/lua_table.cpp +++ b/tests/inclusion/source/lua_table.cpp @@ -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/tests/inclusion/source/lua_value.cpp b/tests/inclusion/source/lua_value.cpp index b82ebe0c..6c5ba3b6 100644 --- a/tests/inclusion/source/lua_value.cpp +++ b/tests/inclusion/source/lua_value.cpp @@ -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/tests/inclusion/source/main.cpp b/tests/inclusion/source/main.cpp index fe92f04b..6e8ecb0a 100644 --- a/tests/inclusion/source/main.cpp +++ b/tests/inclusion/source/main.cpp @@ -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 @@ -25,4 +25,4 @@ int main() { return 0; -} \ No newline at end of file +} diff --git a/tests/inclusion/source/make_reference.cpp b/tests/inclusion/source/make_reference.cpp index d0264f4b..ac8c16a3 100644 --- a/tests/inclusion/source/make_reference.cpp +++ b/tests/inclusion/source/make_reference.cpp @@ -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/tests/inclusion/source/metatable.cpp b/tests/inclusion/source/metatable.cpp index f437a371..60f87bf3 100644 --- a/tests/inclusion/source/metatable.cpp +++ b/tests/inclusion/source/metatable.cpp @@ -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/tests/inclusion/source/object.cpp b/tests/inclusion/source/object.cpp index eeb56c1e..6429dd81 100644 --- a/tests/inclusion/source/object.cpp +++ b/tests/inclusion/source/object.cpp @@ -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/tests/inclusion/source/object_base.cpp b/tests/inclusion/source/object_base.cpp index 3b83de99..40fe3736 100644 --- a/tests/inclusion/source/object_base.cpp +++ b/tests/inclusion/source/object_base.cpp @@ -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/tests/inclusion/source/optional.cpp b/tests/inclusion/source/optional.cpp index 51fdda82..25ae13e9 100644 --- a/tests/inclusion/source/optional.cpp +++ b/tests/inclusion/source/optional.cpp @@ -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/tests/inclusion/source/optional_implementation.cpp b/tests/inclusion/source/optional_implementation.cpp index 223eac32..a32695db 100644 --- a/tests/inclusion/source/optional_implementation.cpp +++ b/tests/inclusion/source/optional_implementation.cpp @@ -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/tests/inclusion/source/overload.cpp b/tests/inclusion/source/overload.cpp index e36bfe7c..48eb0990 100644 --- a/tests/inclusion/source/overload.cpp +++ b/tests/inclusion/source/overload.cpp @@ -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/tests/inclusion/source/packaged_coroutine.cpp b/tests/inclusion/source/packaged_coroutine.cpp index a78c2348..bb0026b7 100644 --- a/tests/inclusion/source/packaged_coroutine.cpp +++ b/tests/inclusion/source/packaged_coroutine.cpp @@ -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/tests/inclusion/source/pairs_iterator.cpp b/tests/inclusion/source/pairs_iterator.cpp index 75af975f..f6fdbd20 100644 --- a/tests/inclusion/source/pairs_iterator.cpp +++ b/tests/inclusion/source/pairs_iterator.cpp @@ -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/tests/inclusion/source/pointer_like.cpp b/tests/inclusion/source/pointer_like.cpp index ad6d12e3..2bcf252c 100644 --- a/tests/inclusion/source/pointer_like.cpp +++ b/tests/inclusion/source/pointer_like.cpp @@ -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/tests/inclusion/source/policies.cpp b/tests/inclusion/source/policies.cpp index 1d8168ad..d6423f01 100644 --- a/tests/inclusion/source/policies.cpp +++ b/tests/inclusion/source/policies.cpp @@ -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/tests/inclusion/source/property.cpp b/tests/inclusion/source/property.cpp index 6675821a..35783921 100644 --- a/tests/inclusion/source/property.cpp +++ b/tests/inclusion/source/property.cpp @@ -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/tests/inclusion/source/protect.cpp b/tests/inclusion/source/protect.cpp index 89cfd892..f0999588 100644 --- a/tests/inclusion/source/protect.cpp +++ b/tests/inclusion/source/protect.cpp @@ -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/tests/inclusion/source/protected_function.cpp b/tests/inclusion/source/protected_function.cpp index 73e489c7..50527ff7 100644 --- a/tests/inclusion/source/protected_function.cpp +++ b/tests/inclusion/source/protected_function.cpp @@ -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/tests/inclusion/source/protected_function_result.cpp b/tests/inclusion/source/protected_function_result.cpp index c3446d26..9fe22175 100644 --- a/tests/inclusion/source/protected_function_result.cpp +++ b/tests/inclusion/source/protected_function_result.cpp @@ -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/tests/inclusion/source/protected_handler.cpp b/tests/inclusion/source/protected_handler.cpp index 9baa5e36..b7d5f121 100644 --- a/tests/inclusion/source/protected_handler.cpp +++ b/tests/inclusion/source/protected_handler.cpp @@ -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/tests/inclusion/source/proxy.cpp b/tests/inclusion/source/proxy.cpp index 162761e8..6bb17896 100644 --- a/tests/inclusion/source/proxy.cpp +++ b/tests/inclusion/source/proxy.cpp @@ -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/tests/inclusion/source/proxy_base.cpp b/tests/inclusion/source/proxy_base.cpp index 3438358b..2944ef8c 100644 --- a/tests/inclusion/source/proxy_base.cpp +++ b/tests/inclusion/source/proxy_base.cpp @@ -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/tests/inclusion/source/raii.cpp b/tests/inclusion/source/raii.cpp index e9319972..594fa1aa 100644 --- a/tests/inclusion/source/raii.cpp +++ b/tests/inclusion/source/raii.cpp @@ -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/tests/inclusion/source/reference.cpp b/tests/inclusion/source/reference.cpp index 8521eba5..54059149 100644 --- a/tests/inclusion/source/reference.cpp +++ b/tests/inclusion/source/reference.cpp @@ -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/tests/inclusion/source/resolve.cpp b/tests/inclusion/source/resolve.cpp index e215e9b5..1f8ba962 100644 --- a/tests/inclusion/source/resolve.cpp +++ b/tests/inclusion/source/resolve.cpp @@ -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/tests/inclusion/source/sol.cpp b/tests/inclusion/source/sol.cpp index 00325fd7..e202b36f 100644 --- a/tests/inclusion/source/sol.cpp +++ b/tests/inclusion/source/sol.cpp @@ -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/tests/inclusion/source/stack.cpp b/tests/inclusion/source/stack.cpp index b21a099b..ba24a991 100644 --- a/tests/inclusion/source/stack.cpp +++ b/tests/inclusion/source/stack.cpp @@ -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/tests/inclusion/source/stack/detail/pairs.cpp b/tests/inclusion/source/stack/detail/pairs.cpp index ad3c9bd0..8a59cafa 100644 --- a/tests/inclusion/source/stack/detail/pairs.cpp +++ b/tests/inclusion/source/stack/detail/pairs.cpp @@ -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/tests/inclusion/source/stack_check.cpp b/tests/inclusion/source/stack_check.cpp index 3ae2ca68..588d803e 100644 --- a/tests/inclusion/source/stack_check.cpp +++ b/tests/inclusion/source/stack_check.cpp @@ -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/tests/inclusion/source/stack_check_get.cpp b/tests/inclusion/source/stack_check_get.cpp index 6aca04e2..fc034683 100644 --- a/tests/inclusion/source/stack_check_get.cpp +++ b/tests/inclusion/source/stack_check_get.cpp @@ -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/tests/inclusion/source/stack_check_get_qualified.cpp b/tests/inclusion/source/stack_check_get_qualified.cpp index fd6861fa..c74806f3 100644 --- a/tests/inclusion/source/stack_check_get_qualified.cpp +++ b/tests/inclusion/source/stack_check_get_qualified.cpp @@ -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/tests/inclusion/source/stack_check_get_unqualified.cpp b/tests/inclusion/source/stack_check_get_unqualified.cpp index a1c558d6..019e1804 100644 --- a/tests/inclusion/source/stack_check_get_unqualified.cpp +++ b/tests/inclusion/source/stack_check_get_unqualified.cpp @@ -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/tests/inclusion/source/stack_check_qualified.cpp b/tests/inclusion/source/stack_check_qualified.cpp index 759414c0..e5492a9b 100644 --- a/tests/inclusion/source/stack_check_qualified.cpp +++ b/tests/inclusion/source/stack_check_qualified.cpp @@ -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/tests/inclusion/source/stack_check_unqualified.cpp b/tests/inclusion/source/stack_check_unqualified.cpp index 7557d10c..8ebf0759 100644 --- a/tests/inclusion/source/stack_check_unqualified.cpp +++ b/tests/inclusion/source/stack_check_unqualified.cpp @@ -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/tests/inclusion/source/stack_core.cpp b/tests/inclusion/source/stack_core.cpp index 79d44945..94578064 100644 --- a/tests/inclusion/source/stack_core.cpp +++ b/tests/inclusion/source/stack_core.cpp @@ -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/tests/inclusion/source/stack_field.cpp b/tests/inclusion/source/stack_field.cpp index 40b81d2d..16ee47af 100644 --- a/tests/inclusion/source/stack_field.cpp +++ b/tests/inclusion/source/stack_field.cpp @@ -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/tests/inclusion/source/stack_get.cpp b/tests/inclusion/source/stack_get.cpp index 85305b06..64d0c27a 100644 --- a/tests/inclusion/source/stack_get.cpp +++ b/tests/inclusion/source/stack_get.cpp @@ -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/tests/inclusion/source/stack_get_qualified.cpp b/tests/inclusion/source/stack_get_qualified.cpp index 96ad0d40..b10930b3 100644 --- a/tests/inclusion/source/stack_get_qualified.cpp +++ b/tests/inclusion/source/stack_get_qualified.cpp @@ -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/tests/inclusion/source/stack_get_unqualified.cpp b/tests/inclusion/source/stack_get_unqualified.cpp index 92d065f3..e287b782 100644 --- a/tests/inclusion/source/stack_get_unqualified.cpp +++ b/tests/inclusion/source/stack_get_unqualified.cpp @@ -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/tests/inclusion/source/stack_guard.cpp b/tests/inclusion/source/stack_guard.cpp index 0d0a3fbd..c6200094 100644 --- a/tests/inclusion/source/stack_guard.cpp +++ b/tests/inclusion/source/stack_guard.cpp @@ -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/tests/inclusion/source/stack_iterator.cpp b/tests/inclusion/source/stack_iterator.cpp index 23a7724a..8bc3d6c5 100644 --- a/tests/inclusion/source/stack_iterator.cpp +++ b/tests/inclusion/source/stack_iterator.cpp @@ -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/tests/inclusion/source/stack_pop.cpp b/tests/inclusion/source/stack_pop.cpp index 83bacb85..47445438 100644 --- a/tests/inclusion/source/stack_pop.cpp +++ b/tests/inclusion/source/stack_pop.cpp @@ -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/tests/inclusion/source/stack_probe.cpp b/tests/inclusion/source/stack_probe.cpp index 3c78e248..c96485e1 100644 --- a/tests/inclusion/source/stack_probe.cpp +++ b/tests/inclusion/source/stack_probe.cpp @@ -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/tests/inclusion/source/stack_proxy.cpp b/tests/inclusion/source/stack_proxy.cpp index 77e1b743..28680b47 100644 --- a/tests/inclusion/source/stack_proxy.cpp +++ b/tests/inclusion/source/stack_proxy.cpp @@ -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/tests/inclusion/source/stack_proxy_base.cpp b/tests/inclusion/source/stack_proxy_base.cpp index d8a5f214..4fd4ce32 100644 --- a/tests/inclusion/source/stack_proxy_base.cpp +++ b/tests/inclusion/source/stack_proxy_base.cpp @@ -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/tests/inclusion/source/stack_push.cpp b/tests/inclusion/source/stack_push.cpp index 55708c06..e457d9ca 100644 --- a/tests/inclusion/source/stack_push.cpp +++ b/tests/inclusion/source/stack_push.cpp @@ -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/tests/inclusion/source/stack_reference.cpp b/tests/inclusion/source/stack_reference.cpp index 28d9cb0f..fd5cf091 100644 --- a/tests/inclusion/source/stack_reference.cpp +++ b/tests/inclusion/source/stack_reference.cpp @@ -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/tests/inclusion/source/state_handling.cpp b/tests/inclusion/source/state_handling.cpp index 636f4057..2527696d 100644 --- a/tests/inclusion/source/state_handling.cpp +++ b/tests/inclusion/source/state_handling.cpp @@ -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/tests/inclusion/source/string_view.cpp b/tests/inclusion/source/string_view.cpp index 944932a1..33a275d2 100644 --- a/tests/inclusion/source/string_view.cpp +++ b/tests/inclusion/source/string_view.cpp @@ -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/tests/inclusion/source/table.cpp b/tests/inclusion/source/table.cpp index 05d16ace..9e36b7b8 100644 --- a/tests/inclusion/source/table.cpp +++ b/tests/inclusion/source/table.cpp @@ -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/tests/inclusion/source/table_core.cpp b/tests/inclusion/source/table_core.cpp index 84fb73a6..88f36639 100644 --- a/tests/inclusion/source/table_core.cpp +++ b/tests/inclusion/source/table_core.cpp @@ -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/tests/inclusion/source/table_iterator.cpp b/tests/inclusion/source/table_iterator.cpp index 98160185..eb2f0676 100644 --- a/tests/inclusion/source/table_iterator.cpp +++ b/tests/inclusion/source/table_iterator.cpp @@ -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/tests/inclusion/source/thread.cpp b/tests/inclusion/source/thread.cpp index 2df7e086..5bafd269 100644 --- a/tests/inclusion/source/thread.cpp +++ b/tests/inclusion/source/thread.cpp @@ -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/tests/inclusion/source/tie.cpp b/tests/inclusion/source/tie.cpp index 58c907dd..0b5086cc 100644 --- a/tests/inclusion/source/tie.cpp +++ b/tests/inclusion/source/tie.cpp @@ -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/tests/inclusion/source/traits.cpp b/tests/inclusion/source/traits.cpp index 2dffd39d..32bde9eb 100644 --- a/tests/inclusion/source/traits.cpp +++ b/tests/inclusion/source/traits.cpp @@ -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/tests/inclusion/source/trampoline.cpp b/tests/inclusion/source/trampoline.cpp index e0904694..b2017cdc 100644 --- a/tests/inclusion/source/trampoline.cpp +++ b/tests/inclusion/source/trampoline.cpp @@ -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/tests/inclusion/source/tuple.cpp b/tests/inclusion/source/tuple.cpp index d0c8cd07..e8822ad2 100644 --- a/tests/inclusion/source/tuple.cpp +++ b/tests/inclusion/source/tuple.cpp @@ -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/tests/inclusion/source/types.cpp b/tests/inclusion/source/types.cpp index ec22f225..bd87b045 100644 --- a/tests/inclusion/source/types.cpp +++ b/tests/inclusion/source/types.cpp @@ -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/tests/inclusion/source/unicode.cpp b/tests/inclusion/source/unicode.cpp index 2515581d..2d80832d 100644 --- a/tests/inclusion/source/unicode.cpp +++ b/tests/inclusion/source/unicode.cpp @@ -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/tests/inclusion/source/unique_usertype_traits.cpp b/tests/inclusion/source/unique_usertype_traits.cpp index cc68ac86..9ed5df28 100644 --- a/tests/inclusion/source/unique_usertype_traits.cpp +++ b/tests/inclusion/source/unique_usertype_traits.cpp @@ -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/tests/inclusion/source/unsafe_function.cpp b/tests/inclusion/source/unsafe_function.cpp index 6acb604c..f2cc7c00 100644 --- a/tests/inclusion/source/unsafe_function.cpp +++ b/tests/inclusion/source/unsafe_function.cpp @@ -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/tests/inclusion/source/unsafe_function_result.cpp b/tests/inclusion/source/unsafe_function_result.cpp index ae9a687c..6a62b2c2 100644 --- a/tests/inclusion/source/unsafe_function_result.cpp +++ b/tests/inclusion/source/unsafe_function_result.cpp @@ -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/tests/inclusion/source/userdata.cpp b/tests/inclusion/source/userdata.cpp index 584ec35e..2b50a3af 100644 --- a/tests/inclusion/source/userdata.cpp +++ b/tests/inclusion/source/userdata.cpp @@ -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/tests/inclusion/source/usertype.cpp b/tests/inclusion/source/usertype.cpp index 745c882f..67e5ef09 100644 --- a/tests/inclusion/source/usertype.cpp +++ b/tests/inclusion/source/usertype.cpp @@ -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/tests/inclusion/source/usertype_container.cpp b/tests/inclusion/source/usertype_container.cpp index 28632a5c..73abe25b 100644 --- a/tests/inclusion/source/usertype_container.cpp +++ b/tests/inclusion/source/usertype_container.cpp @@ -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/tests/inclusion/source/usertype_container_launch.cpp b/tests/inclusion/source/usertype_container_launch.cpp index 1cf46409..4b8f55fe 100644 --- a/tests/inclusion/source/usertype_container_launch.cpp +++ b/tests/inclusion/source/usertype_container_launch.cpp @@ -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/tests/inclusion/source/usertype_core.cpp b/tests/inclusion/source/usertype_core.cpp index 542a9a39..505d228f 100644 --- a/tests/inclusion/source/usertype_core.cpp +++ b/tests/inclusion/source/usertype_core.cpp @@ -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/tests/inclusion/source/usertype_proxy.cpp b/tests/inclusion/source/usertype_proxy.cpp index 664c23b8..77d6ffad 100644 --- a/tests/inclusion/source/usertype_proxy.cpp +++ b/tests/inclusion/source/usertype_proxy.cpp @@ -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/tests/inclusion/source/usertype_storage.cpp b/tests/inclusion/source/usertype_storage.cpp index 64581674..97ba4802 100644 --- a/tests/inclusion/source/usertype_storage.cpp +++ b/tests/inclusion/source/usertype_storage.cpp @@ -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/tests/inclusion/source/usertype_traits.cpp b/tests/inclusion/source/usertype_traits.cpp index 3a65bc49..f5e63ac3 100644 --- a/tests/inclusion/source/usertype_traits.cpp +++ b/tests/inclusion/source/usertype_traits.cpp @@ -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/tests/inclusion/source/variadic_args.cpp b/tests/inclusion/source/variadic_args.cpp index 18259655..3dad62c0 100644 --- a/tests/inclusion/source/variadic_args.cpp +++ b/tests/inclusion/source/variadic_args.cpp @@ -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/tests/inclusion/source/variadic_results.cpp b/tests/inclusion/source/variadic_results.cpp index 44d2fcb1..1c7f7420 100644 --- a/tests/inclusion/source/variadic_results.cpp +++ b/tests/inclusion/source/variadic_results.cpp @@ -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/tests/inclusion/source/version.cpp b/tests/inclusion/source/version.cpp index 7ebc530a..246a4e4e 100644 --- a/tests/inclusion/source/version.cpp +++ b/tests/inclusion/source/version.cpp @@ -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/tests/inclusion/source/wrapper.cpp b/tests/inclusion/source/wrapper.cpp index 58807853..5dcc89d5 100644 --- a/tests/inclusion/source/wrapper.cpp +++ b/tests/inclusion/source/wrapper.cpp @@ -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/tests/lua_lifetime/CMakeLists.txt b/tests/lua_lifetime/CMakeLists.txt index 743605e2..a449c0ae 100644 --- a/tests/lua_lifetime/CMakeLists.txt +++ b/tests/lua_lifetime/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/numerics/CMakeLists.txt b/tests/numerics/CMakeLists.txt index 4cc8bf03..7485606b 100644 --- a/tests/numerics/CMakeLists.txt +++ b/tests/numerics/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/numerics/source/large.cpp b/tests/numerics/source/large.cpp index cb7b1cec..815330fc 100644 --- a/tests/numerics/source/large.cpp +++ b/tests/numerics/source/large.cpp @@ -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/tests/numerics/source/main.cpp b/tests/numerics/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/numerics/source/main.cpp +++ b/tests/numerics/source/main.cpp @@ -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/tests/regression_tests/1011/CMakeLists.txt b/tests/regression_tests/1011/CMakeLists.txt index f153f403..457d9ad1 100644 --- a/tests/regression_tests/1011/CMakeLists.txt +++ b/tests/regression_tests/1011/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/regression_tests/CMakeLists.txt b/tests/regression_tests/CMakeLists.txt index 46fb19fd..7af8ed61 100644 --- a/tests/regression_tests/CMakeLists.txt +++ b/tests/regression_tests/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/regression_tests/simple/CMakeLists.txt b/tests/regression_tests/simple/CMakeLists.txt index 243e27b4..9f9b2fcf 100644 --- a/tests/regression_tests/simple/CMakeLists.txt +++ b/tests/regression_tests/simple/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/regression_tests/simple/source/1000 - readonly warning.cpp b/tests/regression_tests/simple/source/1000 - readonly warning.cpp index ab9f8e60..b7aafa6e 100644 --- a/tests/regression_tests/simple/source/1000 - readonly warning.cpp +++ b/tests/regression_tests/simple/source/1000 - readonly warning.cpp @@ -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/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp b/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp index 7f63d529..abef52fd 100644 --- a/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp +++ b/tests/regression_tests/simple/source/1008 - as_function binding triggers correctly.cpp @@ -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/tests/regression_tests/simple/source/1067 - optional bindings.cpp b/tests/regression_tests/simple/source/1067 - optional bindings.cpp index 36be8f63..40727561 100644 --- a/tests/regression_tests/simple/source/1067 - optional bindings.cpp +++ b/tests/regression_tests/simple/source/1067 - optional bindings.cpp @@ -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/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp b/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp index 5b770931..25c7f784 100644 --- a/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp +++ b/tests/regression_tests/simple/source/1072 - capture exception propagation.cpp @@ -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/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp b/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp index 6b422361..3ea4dc21 100644 --- a/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp +++ b/tests/regression_tests/simple/source/1087 - readonly property error checking.cpp @@ -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/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp b/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp index 80b78897..cd9586dc 100644 --- a/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp +++ b/tests/regression_tests/simple/source/1095 - raw_get from global table fails.cpp @@ -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/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp b/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp index c51daed1..81075f9b 100644 --- a/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp +++ b/tests/regression_tests/simple/source/1096 - functions binding wrong.cpp @@ -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/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp b/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp index 1a96875a..f2c18b3d 100644 --- a/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp +++ b/tests/regression_tests/simple/source/1144 - type destructed from non-destructed memory.cpp @@ -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/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp b/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp index bc5f0f14..6044d8c0 100644 --- a/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp +++ b/tests/regression_tests/simple/source/1149 - static method gets const-morphed in internals.cpp @@ -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/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp b/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp index 70ed6e04..5821670e 100644 --- a/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp +++ b/tests/regression_tests/simple/source/1192 - incorrect alignment calculation.cpp @@ -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/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp b/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp index 7be076db..5903ada0 100644 --- a/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp +++ b/tests/regression_tests/simple/source/1211 - protected_function_result nullptr.cpp @@ -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/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp b/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp index f4dc9012..40ec6b0c 100644 --- a/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp +++ b/tests/regression_tests/simple/source/1266 - add method in Lua 5.4 showing freelist.cpp @@ -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/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp b/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp index 37562860..2ba7acd2 100644 --- a/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp +++ b/tests/regression_tests/simple/source/1315 - keep-alive memory.cpp @@ -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/tests/regression_tests/simple/source/main.cpp b/tests/regression_tests/simple/source/main.cpp index bdceb49b..43e1e320 100644 --- a/tests/regression_tests/simple/source/main.cpp +++ b/tests/regression_tests/simple/source/main.cpp @@ -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/tests/run_time/CMakeLists.txt b/tests/run_time/CMakeLists.txt index 584a0ced..c412a9de 100644 --- a/tests/run_time/CMakeLists.txt +++ b/tests/run_time/CMakeLists.txt @@ -1,7 +1,7 @@ # # # # sol2 # 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/tests/run_time/source/basic.cpp b/tests/run_time/source/basic.cpp index 5a8d013b..69e1b9a1 100644 --- a/tests/run_time/source/basic.cpp +++ b/tests/run_time/source/basic.cpp @@ -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/tests/run_time/source/common_classes.hpp b/tests/run_time/source/common_classes.hpp index 7de5290d..093442de 100644 --- a/tests/run_time/source/common_classes.hpp +++ b/tests/run_time/source/common_classes.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 @@ -189,4 +189,4 @@ struct lua_object { } }; -#endif // SOL_TESTS_COMMON_CLASSES_HPP \ No newline at end of file +#endif // SOL_TESTS_COMMON_CLASSES_HPP diff --git a/tests/run_time/source/container.usertype_check.cpp b/tests/run_time/source/container.usertype_check.cpp index 751b0626..db384968 100644 --- a/tests/run_time/source/container.usertype_check.cpp +++ b/tests/run_time/source/container.usertype_check.cpp @@ -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/tests/run_time/source/container_semantics.cpp b/tests/run_time/source/container_semantics.cpp index 6d45904d..3d2affab 100644 --- a/tests/run_time/source/container_semantics.cpp +++ b/tests/run_time/source/container_semantics.cpp @@ -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/tests/run_time/source/container_semantics.custom.cpp b/tests/run_time/source/container_semantics.custom.cpp index 4f01985e..093fcb7e 100644 --- a/tests/run_time/source/container_semantics.custom.cpp +++ b/tests/run_time/source/container_semantics.custom.cpp @@ -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/tests/run_time/source/container_semantics.ordered.cpp b/tests/run_time/source/container_semantics.ordered.cpp index 04a0664d..4a87b878 100644 --- a/tests/run_time/source/container_semantics.ordered.cpp +++ b/tests/run_time/source/container_semantics.ordered.cpp @@ -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/tests/run_time/source/container_semantics.unordered.cpp b/tests/run_time/source/container_semantics.unordered.cpp index 4c5d328b..f6e10b91 100644 --- a/tests/run_time/source/container_semantics.unordered.cpp +++ b/tests/run_time/source/container_semantics.unordered.cpp @@ -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/tests/run_time/source/container_shims.cpp b/tests/run_time/source/container_shims.cpp index e0a37202..b8e7b3a1 100644 --- a/tests/run_time/source/container_shims.cpp +++ b/tests/run_time/source/container_shims.cpp @@ -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/tests/run_time/source/container_table.cpp b/tests/run_time/source/container_table.cpp index 7d53f25b..bb38d6c4 100644 --- a/tests/run_time/source/container_table.cpp +++ b/tests/run_time/source/container_table.cpp @@ -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/tests/run_time/source/containers.cpp b/tests/run_time/source/containers.cpp index 5692f196..ed2cdfac 100644 --- a/tests/run_time/source/containers.cpp +++ b/tests/run_time/source/containers.cpp @@ -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/tests/run_time/source/containers.roundtrip.cpp b/tests/run_time/source/containers.roundtrip.cpp index 224f51cb..0acb956d 100644 --- a/tests/run_time/source/containers.roundtrip.cpp +++ b/tests/run_time/source/containers.roundtrip.cpp @@ -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/tests/run_time/source/containers.table.cpp b/tests/run_time/source/containers.table.cpp index b5d3e6a6..0f5c9faa 100644 --- a/tests/run_time/source/containers.table.cpp +++ b/tests/run_time/source/containers.table.cpp @@ -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/tests/run_time/source/coroutines.cpp b/tests/run_time/source/coroutines.cpp index f1501f22..6347517e 100644 --- a/tests/run_time/source/coroutines.cpp +++ b/tests/run_time/source/coroutines.cpp @@ -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/tests/run_time/source/customizations.cpp b/tests/run_time/source/customizations.cpp index 61e5c238..e4f6c1f8 100644 --- a/tests/run_time/source/customizations.cpp +++ b/tests/run_time/source/customizations.cpp @@ -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/tests/run_time/source/customizations_private.cpp b/tests/run_time/source/customizations_private.cpp index 9f0492b7..284e22f7 100644 --- a/tests/run_time/source/customizations_private.cpp +++ b/tests/run_time/source/customizations_private.cpp @@ -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/tests/run_time/source/dump.cpp b/tests/run_time/source/dump.cpp index b6453a7d..85957002 100644 --- a/tests/run_time/source/dump.cpp +++ b/tests/run_time/source/dump.cpp @@ -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/tests/run_time/source/functions.cpp b/tests/run_time/source/functions.cpp index 2a0b561a..dca4be65 100644 --- a/tests/run_time/source/functions.cpp +++ b/tests/run_time/source/functions.cpp @@ -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/tests/run_time/source/functions.std.cpp b/tests/run_time/source/functions.std.cpp index 1b69d647..3d06cef5 100644 --- a/tests/run_time/source/functions.std.cpp +++ b/tests/run_time/source/functions.std.cpp @@ -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/tests/run_time/source/gc.cpp b/tests/run_time/source/gc.cpp index 73c37529..73f7972e 100644 --- a/tests/run_time/source/gc.cpp +++ b/tests/run_time/source/gc.cpp @@ -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/tests/run_time/source/lua_value.cpp b/tests/run_time/source/lua_value.cpp index efde532b..d76a3f74 100644 --- a/tests/run_time/source/lua_value.cpp +++ b/tests/run_time/source/lua_value.cpp @@ -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/tests/run_time/source/main.cpp b/tests/run_time/source/main.cpp index 839327e9..0f13865b 100644 --- a/tests/run_time/source/main.cpp +++ b/tests/run_time/source/main.cpp @@ -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/tests/run_time/source/operators.cpp b/tests/run_time/source/operators.cpp index b4e78e0b..70b3ca7e 100644 --- a/tests/run_time/source/operators.cpp +++ b/tests/run_time/source/operators.cpp @@ -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/tests/run_time/source/overflow.cpp b/tests/run_time/source/overflow.cpp index 32cff138..d40fe5fe 100644 --- a/tests/run_time/source/overflow.cpp +++ b/tests/run_time/source/overflow.cpp @@ -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/tests/run_time/source/plain_types.cpp b/tests/run_time/source/plain_types.cpp index cb3f6f0b..ff05024c 100644 --- a/tests/run_time/source/plain_types.cpp +++ b/tests/run_time/source/plain_types.cpp @@ -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/tests/run_time/source/policies.cpp b/tests/run_time/source/policies.cpp index 64264fea..8a552638 100644 --- a/tests/run_time/source/policies.cpp +++ b/tests/run_time/source/policies.cpp @@ -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/tests/run_time/source/proxies.cpp b/tests/run_time/source/proxies.cpp index 564a47f2..632eee8f 100644 --- a/tests/run_time/source/proxies.cpp +++ b/tests/run_time/source/proxies.cpp @@ -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/tests/run_time/source/sol_test.hpp b/tests/run_time/source/sol_test.hpp index 958e6e74..56de29ba 100644 --- a/tests/run_time/source/sol_test.hpp +++ b/tests/run_time/source/sol_test.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/tests/run_time/source/state.cpp b/tests/run_time/source/state.cpp index 2e15620b..8f33bde3 100644 --- a/tests/run_time/source/state.cpp +++ b/tests/run_time/source/state.cpp @@ -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/tests/run_time/source/storage.cpp b/tests/run_time/source/storage.cpp index c382ba59..aae5807c 100644 --- a/tests/run_time/source/storage.cpp +++ b/tests/run_time/source/storage.cpp @@ -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/tests/run_time/source/strings.cpp b/tests/run_time/source/strings.cpp index 1fe055af..6e82b343 100644 --- a/tests/run_time/source/strings.cpp +++ b/tests/run_time/source/strings.cpp @@ -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/tests/run_time/source/tables.checks.cpp b/tests/run_time/source/tables.checks.cpp index 7dbbe80a..09d9f2d7 100644 --- a/tests/run_time/source/tables.checks.cpp +++ b/tests/run_time/source/tables.checks.cpp @@ -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/tests/run_time/source/tables.clear.cpp b/tests/run_time/source/tables.clear.cpp index dc1071b2..e184a100 100644 --- a/tests/run_time/source/tables.clear.cpp +++ b/tests/run_time/source/tables.clear.cpp @@ -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/tests/run_time/source/tables.cpp b/tests/run_time/source/tables.cpp index a45ec3f9..134735f6 100644 --- a/tests/run_time/source/tables.cpp +++ b/tests/run_time/source/tables.cpp @@ -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/tests/run_time/source/tables.enums.cpp b/tests/run_time/source/tables.enums.cpp index 19421d9c..807ad396 100644 --- a/tests/run_time/source/tables.enums.cpp +++ b/tests/run_time/source/tables.enums.cpp @@ -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/tests/run_time/source/tables.indexing.cpp b/tests/run_time/source/tables.indexing.cpp index dfb106e5..3e5e1c81 100644 --- a/tests/run_time/source/tables.indexing.cpp +++ b/tests/run_time/source/tables.indexing.cpp @@ -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/tests/run_time/source/tables.insertion.cpp b/tests/run_time/source/tables.insertion.cpp index 38557d50..e2c7231b 100644 --- a/tests/run_time/source/tables.insertion.cpp +++ b/tests/run_time/source/tables.insertion.cpp @@ -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/tests/run_time/source/tables.traversal.cpp b/tests/run_time/source/tables.traversal.cpp index fffd022f..05f2bfa8 100644 --- a/tests/run_time/source/tables.traversal.cpp +++ b/tests/run_time/source/tables.traversal.cpp @@ -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/tests/run_time/source/usertypes.auxiliary_keys.cpp b/tests/run_time/source/usertypes.auxiliary_keys.cpp index 94404cf2..f6b85de3 100644 --- a/tests/run_time/source/usertypes.auxiliary_keys.cpp +++ b/tests/run_time/source/usertypes.auxiliary_keys.cpp @@ -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/tests/run_time/source/usertypes.basic.cpp b/tests/run_time/source/usertypes.basic.cpp index a03c1c2b..3f555ee2 100644 --- a/tests/run_time/source/usertypes.basic.cpp +++ b/tests/run_time/source/usertypes.basic.cpp @@ -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/tests/run_time/source/usertypes.constructors.cpp b/tests/run_time/source/usertypes.constructors.cpp index 72f9e492..32a35e03 100644 --- a/tests/run_time/source/usertypes.constructors.cpp +++ b/tests/run_time/source/usertypes.constructors.cpp @@ -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/tests/run_time/source/usertypes.cpp b/tests/run_time/source/usertypes.cpp index f1c12197..258171e0 100644 --- a/tests/run_time/source/usertypes.cpp +++ b/tests/run_time/source/usertypes.cpp @@ -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/tests/run_time/source/usertypes.inheritance.cpp b/tests/run_time/source/usertypes.inheritance.cpp index d70417c1..5edd687e 100644 --- a/tests/run_time/source/usertypes.inheritance.cpp +++ b/tests/run_time/source/usertypes.inheritance.cpp @@ -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/tests/run_time/source/usertypes.inheritance.multi.cpp b/tests/run_time/source/usertypes.inheritance.multi.cpp index b50b30ed..9091551d 100644 --- a/tests/run_time/source/usertypes.inheritance.multi.cpp +++ b/tests/run_time/source/usertypes.inheritance.multi.cpp @@ -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/tests/run_time/source/usertypes.member_variables.cpp b/tests/run_time/source/usertypes.member_variables.cpp index 2d5a4621..586c0fd9 100644 --- a/tests/run_time/source/usertypes.member_variables.cpp +++ b/tests/run_time/source/usertypes.member_variables.cpp @@ -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/tests/run_time/source/usertypes.overload.cpp b/tests/run_time/source/usertypes.overload.cpp index 1aaba43a..439aa19e 100644 --- a/tests/run_time/source/usertypes.overload.cpp +++ b/tests/run_time/source/usertypes.overload.cpp @@ -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/tests/run_time/source/usertypes.properties.cpp b/tests/run_time/source/usertypes.properties.cpp index d7e274e9..15ac34d0 100644 --- a/tests/run_time/source/usertypes.properties.cpp +++ b/tests/run_time/source/usertypes.properties.cpp @@ -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/tests/run_time/source/usertypes.runtime.cpp b/tests/run_time/source/usertypes.runtime.cpp index 4bc55d09..fb7547b7 100644 --- a/tests/run_time/source/usertypes.runtime.cpp +++ b/tests/run_time/source/usertypes.runtime.cpp @@ -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/tests/run_time/source/usertypes.unique.cpp b/tests/run_time/source/usertypes.unique.cpp index ca3d4464..cfe01af2 100644 --- a/tests/run_time/source/usertypes.unique.cpp +++ b/tests/run_time/source/usertypes.unique.cpp @@ -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/tests/run_time/source/usertypes.unregister.cpp b/tests/run_time/source/usertypes.unregister.cpp index 9dc814e6..e73b47aa 100644 --- a/tests/run_time/source/usertypes.unregister.cpp +++ b/tests/run_time/source/usertypes.unregister.cpp @@ -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/tests/run_time/source/utility.cpp b/tests/run_time/source/utility.cpp index 41ba4545..73858d5d 100644 --- a/tests/run_time/source/utility.cpp +++ b/tests/run_time/source/utility.cpp @@ -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/tests/run_time/source/variadics.cpp b/tests/run_time/source/variadics.cpp index b755839e..6edcc20d 100644 --- a/tests/run_time/source/variadics.cpp +++ b/tests/run_time/source/variadics.cpp @@ -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 From eba86625b707e3c8c99bbfc4624e51f42dc9e561 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 25 Jun 2022 04:06:18 -0400 Subject: [PATCH 18/53] =?UTF-8?q?=E2=9C=8D=20Update=20Copyright=20Year=20f?= =?UTF-8?q?or=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/source/conf.py b/documentation/source/conf.py index 2356ff35..b409d989 100644 --- a/documentation/source/conf.py +++ b/documentation/source/conf.py @@ -52,7 +52,7 @@ # General information about the project. project = 'sol2' -copyright = '2021, ThePhD' +copyright = '2022, ThePhD' author = 'ThePhD' # The version info for the project you're documenting, acts as replacement for @@ -349,4 +349,4 @@ def generate_doxygen_xml(app): def setup(app): # Add hook for building doxygen xml when needed - app.connect("builder-inited", generate_doxygen_xml) \ No newline at end of file + app.connect("builder-inited", generate_doxygen_xml) From dca62a0f02bb45f3de296de3ce00b1275eb34c25 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 25 Jun 2022 20:25:52 +0300 Subject: [PATCH 19/53] Add static_cast to unique_index arg to silence MSVC warning --- include/sol/stack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sol/stack.hpp b/include/sol/stack.hpp index f35b1549..00ebb826 100644 --- a/include/sol/stack.hpp +++ b/include/sol/stack.hpp @@ -207,7 +207,7 @@ namespace sol { int push_count = push(L, std::forward(arg)); sol_c_assert(push_count == 1); std::size_t unique_index = static_cast(luaL_len(L, tableindex) + 1u); - lua_rawseti(L, tableindex, unique_index); + lua_rawseti(L, tableindex, static_cast(unique_index)); } } // namespace stack_detail From 4de99c5b41b64b7e654bf8e48b177e8414a756b7 Mon Sep 17 00:00:00 2001 From: Mihail Date: Wed, 6 Jul 2022 17:43:00 +0200 Subject: [PATCH 20/53] Fixed typo: "almomst" with "almost" --- documentation/source/features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/source/features.rst b/documentation/source/features.rst index c918cca2..6fc1faaf 100644 --- a/documentation/source/features.rst +++ b/documentation/source/features.rst @@ -171,7 +171,7 @@ kaguya - sol - * One of the few libraries with optional support! -* Basically the fastest in almomst all respects: http://sol2.readthedocs.io/en/latest/benchmarks.html +* Basically the fastest in almost all respects: http://sol2.readthedocs.io/en/latest/benchmarks.html * Overloading support can get messy with inheritance, see :doc:`here` * C++14/"C++1y" (-std=c++14, -std=c++1y, =std=c++1z) flags are used (available since GCC 4.9 and Clang 3.5) * Active issues, active individuals From 92cbc71c108809fa82143f7b4963c32e55907981 Mon Sep 17 00:00:00 2001 From: Marcel Gotsch Date: Fri, 26 Aug 2022 15:21:02 +0200 Subject: [PATCH 21/53] add to_string and is_integer utilities --- include/sol/utility/is_integer.hpp | 43 ++++++++++ include/sol/utility/to_string.hpp | 59 +++++++++++++ tests/inclusion/source/utility/is_integer.cpp | 24 ++++++ tests/inclusion/source/utility/to_string.cpp | 24 ++++++ tests/run_time/CMakeLists.txt | 22 +++-- tests/run_time/source/is_integer.cpp | 53 ++++++++++++ tests/run_time/source/to_string.cpp | 83 +++++++++++++++++++ 7 files changed, 296 insertions(+), 12 deletions(-) create mode 100644 include/sol/utility/is_integer.hpp create mode 100644 include/sol/utility/to_string.hpp create mode 100644 tests/inclusion/source/utility/is_integer.cpp create mode 100644 tests/inclusion/source/utility/to_string.cpp create mode 100644 tests/run_time/source/is_integer.cpp create mode 100644 tests/run_time/source/to_string.cpp diff --git a/include/sol/utility/is_integer.hpp b/include/sol/utility/is_integer.hpp new file mode 100644 index 00000000..9292bb63 --- /dev/null +++ b/include/sol/utility/is_integer.hpp @@ -0,0 +1,43 @@ +// 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 Spermission 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_IS_INTEGER_HPP +#define SOL_IS_INTEGER_HPP + +#include + +namespace sol::utility { + + // Returns true if the object is represented by an integer, + // not a floating point number or any other type. + inline bool is_integer(const sol::object& object) { + auto pp = stack::push_pop(object); + return lua_isinteger(object.lua_state(), -1); + } + inline bool is_integer(const sol::stack_object& object) { + return lua_isinteger(object.lua_state(), object.stack_index()); + } + +} // namespace sol::utility + +#endif // SOL_IS_INTEGER_HPP diff --git a/include/sol/utility/to_string.hpp b/include/sol/utility/to_string.hpp new file mode 100644 index 00000000..51b85a4f --- /dev/null +++ b/include/sol/utility/to_string.hpp @@ -0,0 +1,59 @@ +// 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 Spermission 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_TO_STRING_HPP +#define SOL_TO_STRING_HPP + +#include +#include + +#include +#include + +namespace sol::utility { + + // Converts any object into a string using luaL_tolstring. + // + // Note: Uses the metamethod __tostring if available. + inline std::string to_string(const sol::stack_object& object) { + std::size_t len; + const char* str = luaL_tolstring(object.lua_state(), object.stack_index(), &len); + + auto result = std::string(str, len); + + // luaL_tolstring pushes the string onto the stack, but since + // we have copied it into our std::string by now we should + // remove it from the stack. + lua_pop(object.lua_state(), 1); + + return result; + } + + inline std::string to_string(const sol::object& object) { + auto pp = sol::stack::push_pop(object); + return to_string(sol::stack_object(object.lua_state(), -1)); + } + +} // namespace sol::utility + +#endif // SOL_IS_INTEGER_HPP diff --git a/tests/inclusion/source/utility/is_integer.cpp b/tests/inclusion/source/utility/is_integer.cpp new file mode 100644 index 00000000..ed9bc3c8 --- /dev/null +++ b/tests/inclusion/source/utility/is_integer.cpp @@ -0,0 +1,24 @@ +// 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. + +#include diff --git a/tests/inclusion/source/utility/to_string.cpp b/tests/inclusion/source/utility/to_string.cpp new file mode 100644 index 00000000..5313ec1f --- /dev/null +++ b/tests/inclusion/source/utility/to_string.cpp @@ -0,0 +1,24 @@ +// 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. + +#include diff --git a/tests/run_time/CMakeLists.txt b/tests/run_time/CMakeLists.txt index c412a9de..159119b6 100644 --- a/tests/run_time/CMakeLists.txt +++ b/tests/run_time/CMakeLists.txt @@ -1,18 +1,18 @@ # # # # 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 @@ -22,12 +22,12 @@ # # # # sol2 tests - runtime tests -file(GLOB sources - LIST_DIRECTORIES FALSE - CONFIGURE_DEPENDS - source/*.cpp) - -if (WAY_TOO_BUSTED_RIGHT_NOW) +# Many are broken, so we list the working ones manually for now. +set(sources + source/is_integer.cpp + source/main.cpp + source/to_string.cpp +) sol2_create_basic_test(sol2.tests.run_time sol2::sol2 ${sources}) target_compile_definitions(sol2.tests.run_time PRIVATE @@ -37,5 +37,3 @@ if (SOL2_TESTS_SINGLE) target_compile_definitions(sol2.single.tests.run_time PRIVATE SOL_ALL_SAFETIES_ON=1) endif() - -endif() # currently borked diff --git a/tests/run_time/source/is_integer.cpp b/tests/run_time/source/is_integer.cpp new file mode 100644 index 00000000..78300fc8 --- /dev/null +++ b/tests/run_time/source/is_integer.cpp @@ -0,0 +1,53 @@ +// 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. + + +#include "sol_test.hpp" + +#include +#include +#include + +#include + +TEST_CASE("is_integer") { + sol::state lua; + + SECTION("non-numeric type") { + auto object = sol::make_object(lua, "Hello"); + CHECK(!sol::utility::is_integer(object)); + CHECK(!sol::utility::is_integer(sol::stack_object(lua, -1))); + } + + SECTION("floating point") { + auto object = sol::make_object(lua, 5.5); + CHECK(!sol::utility::is_integer(object)); + CHECK(!sol::utility::is_integer(sol::stack_object(lua, -1))); + } + + SECTION("integer") { + auto object = sol::make_object(lua, 5); + CHECK(sol::utility::is_integer(object)); + CHECK(sol::utility::is_integer(sol::stack_object(lua, -1))); + } +} diff --git a/tests/run_time/source/to_string.cpp b/tests/run_time/source/to_string.cpp new file mode 100644 index 00000000..5d8d4707 --- /dev/null +++ b/tests/run_time/source/to_string.cpp @@ -0,0 +1,83 @@ +// 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. + + +#include "sol_test.hpp" + +#include +#include +#include + +#include + +namespace { + int someFunc() { + return 5; + } +} // namespace + +TEST_CASE("to_string") { + using Catch::Matchers::ContainsSubstring; + + sol::state lua; + + SECTION("boolean") { + auto object = sol::make_object(lua, true); + CHECK(sol::utility::to_string(object) == "true"); + + auto pp = sol::stack::push_pop(object); + CHECK(sol::utility::to_string(sol::stack_object(lua, -1)) == "true"); + } + + SECTION("string") { + auto object = sol::make_object(lua, "Hello"); + CHECK(sol::utility::to_string(object) == "Hello"); + + auto pp = sol::stack::push_pop(object); + CHECK(sol::utility::to_string(sol::stack_object(lua, -1)) == "Hello"); + } + + SECTION("number") { + auto object = sol::make_object(lua, 5); + CHECK(sol::utility::to_string(object) == "5"); + + auto pp = sol::stack::push_pop(object); + CHECK(sol::utility::to_string(sol::stack_object(lua, -1)) == "5"); + } + + SECTION("table") { + auto object = lua.create_table(); + CHECK_THAT(sol::utility::to_string(object), ContainsSubstring("table")); + + auto pp = sol::stack::push_pop(object); + CHECK_THAT(sol::utility::to_string(sol::stack_object(lua, -1)), ContainsSubstring("table")); + } + + SECTION("function") { + auto object = sol::make_object(lua, &someFunc); + CHECK_THAT(sol::utility::to_string(object), ContainsSubstring("function")); + + auto pp = sol::stack::push_pop(object); + CHECK_THAT(sol::utility::to_string(sol::stack_object(lua, -1)), ContainsSubstring("function")); + } +} From 8173d265573584e8043d244f3c58da346d022ae1 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Tue, 27 Sep 2022 13:39:28 -0400 Subject: [PATCH 22/53] =?UTF-8?q?=F0=9F=A7=AA=20Restore=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/run_time/CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/run_time/CMakeLists.txt b/tests/run_time/CMakeLists.txt index 159119b6..b2bbfbd6 100644 --- a/tests/run_time/CMakeLists.txt +++ b/tests/run_time/CMakeLists.txt @@ -22,12 +22,10 @@ # # # # sol2 tests - runtime tests -# Many are broken, so we list the working ones manually for now. -set(sources - source/is_integer.cpp - source/main.cpp - source/to_string.cpp -) +file(GLOB sources + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) sol2_create_basic_test(sol2.tests.run_time sol2::sol2 ${sources}) target_compile_definitions(sol2.tests.run_time PRIVATE From e5348c29f13a703896dbe0869f076476d208e5fa Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 25 Sep 2022 22:18:11 +0100 Subject: [PATCH 23/53] Install cmake files to share/ Because this is header-only library, there is no .a/.so which is arch-dependent. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 120dd38d..177fa298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ target_include_directories(sol2 ${sol2-system-include} configure_package_config_file( cmake/sol2-config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake" - INSTALL_DESTINATION lib/cmake/sol2 + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/sol2 NO_CHECK_REQUIRED_COMPONENTS_MACRO) write_basic_package_version_file( @@ -121,7 +121,7 @@ if(SOL2_ENABLE_INSTALL) install(EXPORT sol2 FILE sol2-targets.cmake - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sol2") + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2") install(DIRECTORY include/sol DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") @@ -129,7 +129,7 @@ if(SOL2_ENABLE_INSTALL) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config-version.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sol2") + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2") endif() # # # sol2 Library - Single header target From 0386513a2d59fefe448f4fc8742455ce1fc152ab Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 25 Sep 2022 22:27:06 +0100 Subject: [PATCH 24/53] Export to other projects cmake as sol2::sol2 Fix #1304 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 177fa298..026275ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,7 @@ if(SOL2_ENABLE_INSTALL) EXPORT sol2) install(EXPORT sol2 + NAMESPACE sol2:: FILE sol2-targets.cmake DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2") From c4e843b6dde49e01a1d45178eefc2707c565c794 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Fri, 4 Nov 2022 18:47:13 +0100 Subject: [PATCH 25/53] Fix clang compiler warning [why] Compiling with clang issues this warning (clang 10.0 and 15.0 tested): .../sol/sol.hpp:14541:32: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option] #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" [how] Check if the compiler does know the warning, before trying to turn the warning off. Signed-off-by: Fini Jastrow --- include/sol/protected_function_result.hpp | 2 ++ include/sol/stack_check_get_qualified.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/sol/protected_function_result.hpp b/include/sol/protected_function_result.hpp index 4d53ce04..8fe0b68f 100644 --- a/include/sol/protected_function_result.hpp +++ b/include/sol/protected_function_result.hpp @@ -101,7 +101,9 @@ namespace sol { #if SOL_IS_ON(SOL_COMPILER_GCC) #pragma GCC diagnostic push +#if !SOL_IS_ON(SOL_COMPILER_CLANG) #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #endif template diff --git a/include/sol/stack_check_get_qualified.hpp b/include/sol/stack_check_get_qualified.hpp index 60825033..753f911a 100644 --- a/include/sol/stack_check_get_qualified.hpp +++ b/include/sol/stack_check_get_qualified.hpp @@ -32,7 +32,9 @@ namespace sol { namespace stack { #if SOL_IS_ON(SOL_COMPILER_GCC) #pragma GCC diagnostic push +#if !SOL_IS_ON(SOL_COMPILER_CLANG) #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #endif namespace stack_detail { From 3592851a2a180a84b3149ddeae258c79c7e60e6e Mon Sep 17 00:00:00 2001 From: ShepherdSoasis Date: Wed, 28 Sep 2022 01:56:26 -0400 Subject: [PATCH 26/53] =?UTF-8?q?=E2=9C=A8=20New=20exhaustive=20check=20fe?= =?UTF-8?q?ature=20for=20vectors=20&=20similar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + cmake/Packages/FindLuaBuild.cmake | 2 +- cmake/Packages/FindLuaBuild/LuaVanilla.cmake | 71 +++++------ .../source/tutorial/all-the-things.rst | 2 +- .../interop/LuaBridge/source/LuaBridge.cpp | 10 +- examples/interop/kaguya/source/kaguya.cpp | 10 +- examples/interop/luwra/source/luwra.cpp | 10 +- examples/interop/tolua/source/tolua.cpp | 10 +- .../source/require_from_dll.cpp | 6 +- examples/source/any_return.cpp | 8 +- examples/source/as_returns.cpp | 6 +- examples/source/basic.cpp | 4 +- examples/source/c_array.cpp | 10 +- examples/source/c_call.cpp | 10 +- examples/source/config.cpp | 6 +- .../container_usertype_as_container.cpp | 4 +- examples/source/containers_as_table.cpp | 10 +- examples/source/coroutine_state.cpp | 2 +- examples/source/custom_reader.cpp | 2 +- .../source/customization_convert_on_get.cpp | 4 +- examples/source/customization_multiple.cpp | 4 +- .../source/docs/references_in_lambdas.cpp | 4 +- examples/source/docs/simple_functions.cpp | 4 +- examples/source/docs/simple_structs.cpp | 8 +- examples/source/docs/state_transfer.cpp | 2 +- examples/source/dump.cpp | 8 +- examples/source/dynamic_object.cpp | 4 +- examples/source/environments_on_functions.cpp | 22 ++-- examples/source/exception_handler.cpp | 2 +- examples/source/functions.cpp | 10 +- .../source/index_and_newindex_usertype.cpp | 6 +- examples/source/indirect_function_calls.cpp | 4 +- examples/source/metatable_key_low_level.cpp | 6 +- examples/source/multi_results.cpp | 18 +-- examples/source/overloading_with_members.cpp | 4 +- examples/source/protect.cpp | 2 +- examples/source/require.cpp | 4 +- examples/source/require_override_behavior.cpp | 4 +- examples/source/runtime_additions.cpp | 2 +- examples/source/script_error_handling.cpp | 8 +- examples/source/self_from_lua.cpp | 4 +- examples/source/shared_ptr.cpp | 20 ++-- examples/source/shared_ptr_inheritance.cpp | 2 +- examples/source/stack_aligned_function.cpp | 4 +- .../stack_aligned_stack_handler_function.cpp | 4 +- examples/source/static_variables.cpp | 10 +- examples/source/table_as_container.cpp | 8 +- examples/source/table_create_if_nil.cpp | 4 +- examples/source/table_proxy.cpp | 4 +- examples/source/this_state.cpp | 6 +- examples/source/tie.cpp | 14 +-- examples/source/tutorials/multiple_return.cpp | 8 +- .../quick_n_dirty/functions_easy.cpp | 8 +- .../multiple_returns_from_lua.cpp | 6 +- .../quick_n_dirty/multiple_returns_to_lua.cpp | 10 +- .../tutorials/quick_n_dirty/namespacing.cpp | 2 +- .../quick_n_dirty/running_lua_code.cpp | 4 +- .../running_lua_code_low_level.cpp | 2 +- .../quick_n_dirty/running_lua_code_safely.cpp | 8 +- .../quick_n_dirty/set_and_get_variables.cpp | 20 ++-- .../set_and_get_variables_exists.cpp | 4 +- .../quick_n_dirty/tables_and_nesting.cpp | 12 +- .../tutorials/quick_n_dirty/userdata.cpp | 10 +- .../source/tutorials/reading_functions.cpp | 6 +- examples/source/tutorials/variables_demo.cpp | 10 +- .../source/tutorials/writing_functions.cpp | 2 +- .../writing_overloaded_template_functions.cpp | 4 +- .../tutorials/writing_template_functions.cpp | 4 +- examples/source/unique_ptr.cpp | 16 +-- examples/source/usertype_bitfields.cpp | 6 +- examples/source/usertype_dynamic_get_set.cpp | 6 +- examples/source/usertype_initializers.cpp | 6 +- .../source/usertype_special_functions.cpp | 6 +- examples/source/usertype_var.cpp | 10 +- include/sol/assert.hpp | 16 +-- include/sol/compatibility/lua_version.hpp | 6 +- include/sol/stack.hpp | 4 +- include/sol/stack/detail/pairs.hpp | 2 +- include/sol/stack_check_unqualified.hpp | 99 ++++++++++++++++ include/sol/stack_get_unqualified.hpp | 30 +++-- include/sol/stack_push.hpp | 4 +- include/sol/types.hpp | 71 ++++++++++- include/sol/version.hpp | 22 +++- tests/container_exhaustive/CMakeLists.txt | 34 ++++++ .../source/exhaustive.cpp | 110 ++++++++++++++++++ tests/container_exhaustive/source/main.cpp | 30 +++++ tests/run_time/CMakeLists.txt | 24 ++-- tests/utility/CMakeLists.txt | 34 ++++++ .../source/is_integer.cpp | 106 ++++++++--------- tests/utility/source/main.cpp | 30 +++++ .../source/to_string.cpp | 0 91 files changed, 797 insertions(+), 389 deletions(-) create mode 100644 tests/container_exhaustive/CMakeLists.txt create mode 100644 tests/container_exhaustive/source/exhaustive.cpp create mode 100644 tests/container_exhaustive/source/main.cpp create mode 100644 tests/utility/CMakeLists.txt rename tests/{run_time => utility}/source/is_integer.cpp (97%) create mode 100644 tests/utility/source/main.cpp rename tests/{run_time => utility}/source/to_string.cpp (100%) diff --git a/.gitignore b/.gitignore index 4f42a72f..b4ae4dd8 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,7 @@ x86/ scratch/ # CMake +/.cmake build/ build-sol2/ CMakeCache.txt diff --git a/cmake/Packages/FindLuaBuild.cmake b/cmake/Packages/FindLuaBuild.cmake index 2668ef62..7e6a71f0 100644 --- a/cmake/Packages/FindLuaBuild.cmake +++ b/cmake/Packages/FindLuaBuild.cmake @@ -39,7 +39,7 @@ function(find_lua_build LUA_VERSION) else() set(LUA_BUILD_LIBNAME lua-${LUA_VERSION}) endif() - set(LUA_BUILD_TOPLEVEL "${CMAKE_BINARY_DIR}/vendor/${LUA_BUILD_LIBNAME}") + set(LUA_BUILD_TOPLEVEL "${CMAKE_BINARY_DIR}/_deps/${LUA_BUILD_LIBNAME}") set(LUA_BUILD_INSTALL_DIR "${LUA_BUILD_TOPLEVEL}") # # Misc needed variables set(LUA_BUILD_LIBRARY_DESCRIPTION "The base name of the library to build either the static or the dynamic library") diff --git a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake index b95e5a67..8b1fa541 100644 --- a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake +++ b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake @@ -111,7 +111,7 @@ elseif (LUA_VANILLA_VERSION MATCHES "^5\\.2") set(LUA_VANILLA_LIB_SOURCES lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c - lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c + lauxlib.c lbaselib.c lcorolib.c ldblib.c liolib.c lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c) set(LUA_VANILLA_LUA_SOURCES lua.c ) if (LUA_BUILD_LUA_COMPILER) @@ -144,7 +144,7 @@ if (LUA_BUILD_LUA_COMPILER) endif() set(LUA_VANILLA_GENERATE_LUA_HPP false) else() - MESSAGE(WARNING "Using Lua 5.4.1 file list for ${LUA_VERSION} version") + MESSAGE(WARNING "Using Lua 5.4.4 file list for ${LUA_VERSION} version") set(LUA_VANILLA_LIB_SOURCES lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c ldblib.c ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c @@ -157,66 +157,49 @@ endif() set(LUA_VANILLA_GENERATE_LUA_HPP false) endif() -set(LUA_VANILLA_SOURCE_DIR "${LUA_BUILD_TOPLEVEL}/src") -prepend(LUA_VANILLA_LIB_SOURCES "${LUA_VANILLA_SOURCE_DIR}/" ${LUA_VANILLA_LIB_SOURCES}) -prepend(LUA_VANILLA_LUA_SOURCES "${LUA_VANILLA_SOURCE_DIR}/" ${LUA_VANILLA_LUA_SOURCES}) - # download, just for the sake of download + extract # or pull from local folder if (LUA_LOCAL_DIR) + set(LUA_VANILLA_SOURCE_DIR ${LUA_BUILD_TOPLEVEL}-src) + list(TRANSFORM LUA_VANILLA_LIB_SOURCES PREPEND "${LUA_VANILLA_SOURCE_DIR}/src/") + list(TRANSFORM LUA_VANILLA_LUA_SOURCES PREPEND "${LUA_VANILLA_SOURCE_DIR}/src/") file(COPY "${LUA_LOCAL_DIR}/src" - DESTINATION "${LUA_BUILD_TOPLEVEL}") + DESTINATION "${LUA_VANILLA_SOURCE_DIR}/") file(COPY "${LUA_LOCAL_DIR}/include" - DESTINATION "${LUA_BUILD_TOPLEVEL}") + DESTINATION "${LUA_VANILLA_SOURCE_DIR}/") add_custom_target(LUA_VANILLA DEPENDS "${LUA_VANILLA_LIB_SOURCES}" "${LUA_VANILLA_LUA_SOURCES}") - set(LUA_VANILLA_INCLUDE_DIRS ${LUA_VANILLA_INCLUDE_DIRS} "${LUA_VANILLA_SOURCE_DIR}" "${LUA_BUILD_TOPLEVEL}/include") + set(LUA_VANILLA_INCLUDE_DIRS ${LUA_VANILLA_INCLUDE_DIRS} "${LUA_VANILLA_SOURCE_DIR}/include") else() - ExternalProject_Add(LUA_VANILLA - BUILD_IN_SOURCE TRUE - BUILD_ALWAYS FALSE - TLS_VERIFY TRUE - PREFIX ${LUA_BUILD_TOPLEVEL} - SOURCE_DIR ${LUA_BUILD_TOPLEVEL} - DOWNLOAD_DIR ${LUA_BUILD_TOPLEVEL} - TMP_DIR "${LUA_BUILD_TOPLEVEL}-tmp" - STAMP_DIR "${LUA_BUILD_TOPLEVEL}-stamp" - INSTALL_DIR "${LUA_BUILD_INSTALL_DIR}" - URL ${LUA_VANILLA_DOWNLOAD_URL} - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - TEST_COMMAND "" - BUILD_BYPRODUCTS "${LUA_VANILLA_LIB_SOURCES}" "${LUA_VANILLA_LUA_SOURCES}") - - # make a quick lua.hpp for 5.1 targets that don't have it + include(FetchContent) + FetchContent_Declare( + lua-vanilla + URL ${LUA_VANILLA_DOWNLOAD_URL}) + FetchContent_GetProperties(lua-vanilla) + if ( NOT lua-vanilla_POPULATED) + # Fetch the content using previously declared details + FetchContent_Populate(lua-vanilla) + # do not add_subdirectory / build: we are JUST using ti as a download step! + endif() + list(TRANSFORM LUA_VANILLA_LIB_SOURCES PREPEND "${lua-vanilla_SOURCE_DIR}/src/") + list(TRANSFORM LUA_VANILLA_LUA_SOURCES PREPEND "${lua-vanilla_SOURCE_DIR}/src/") + # make a quick lua.hpp for targets that don't have it if (LUA_VANILLA_GENERATE_LUA_HPP) set(LUA_VANILLA_LUA_HPP_CONTENT "// lua.hpp // Lua header files for C++ // <> not supplied automatically because Lua also compiles as C++ - extern \"C\" { #include \"lua.h\" #include \"lualib.h\" #include \"lauxlib.h\" } ") - set(LUA_VANILLA_SOURCE_LUA_HPP "${LUA_BUILD_TOPLEVEL}-tmp/lua.hpp") - set(LUA_VANILLA_DESTINATION_LUA_HPP "${LUA_VANILLA_SOURCE_DIR}/lua.hpp") - file(WRITE "${LUA_VANILLA_SOURCE_LUA_HPP}" "${LUA_VANILLA_LUA_HPP_CONTENT}") + set(LUA_VANILLA_SOURCE_LUA_HPP "${lua-vanilla_SOURCE_DIR}/include/lua.hpp") + file(CONFIGURE OUTPUT "${LUA_VANILLA_SOURCE_LUA_HPP}" CONTENT "${LUA_VANILLA_LUA_HPP_CONTENT}" @ONLY) file(TO_NATIVE_PATH "${LUA_VANILLA_SOURCE_LUA_HPP}" LUA_VANILLA_SOURCE_LUA_HPP) - file(TO_NATIVE_PATH "${LUA_VANILLA_DESTINATION_LUA_HPP}" LUA_VANILLA_DESTINATION_LUA_HPP) - ExternalProject_Add_Step(LUA_VANILLA - prebuild - # after download, before build - DEPENDEES download - DEPENDERS build - BYPRODUCTS "${LUA_VANILLA_DESTINATION_LUA_HPP}" - COMMENT "Moving \"${LUA_VANILLA_SOURCE_LUA_HPP}\" to \"${LUA_VANILLA_DESTINATION_LUA_HPP}\"..." - COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_VANILLA_SOURCE_LUA_HPP}" "${LUA_VANILLA_DESTINATION_LUA_HPP}") endif() - set(LUA_VANILLA_INCLUDE_DIRS ${LUA_VANILLA_SOURCE_DIR}) + set(LUA_VANILLA_INCLUDE_DIRS ${lua-vanilla_SOURCE_DIR}/include) endif() # # Target names @@ -233,7 +216,7 @@ set(luacompiler "luac-${LUA_VANILLA_VERSION}") # make an actual, buildable target # that other parts of the code can depend on -add_library(${liblua} ${LUA_BUILD_LIBRARY_TYPE} "${LUA_VANILLA_LIB_SOURCES}") +add_library(${liblua} ${LUA_BUILD_LIBRARY_TYPE} ${LUA_VANILLA_LIB_SOURCES}) set_target_properties(${liblua} PROPERTIES LANGUAGE ${LUA_VANILLA_LANGUAGE} @@ -259,8 +242,6 @@ else() PRIVATE -w) endif() if (WIN32) - #target_compile_definitions(${liblua} - # PRIVATE LUA_USE_WINDOWS) else() target_compile_definitions(${liblua} PRIVATE LUA_USE_LINUX) @@ -353,4 +334,4 @@ set(LUA_INTERPRETER ${luainterpreter}) if (LUA_BUILD_LUA_COMPILER) set(LUA_COMPILER ${luacompiler}) endif() -set(LUA_INCLUDE_DIRS "${LUA_VANILLA_SOURCE_DIR}") +set(LUA_INCLUDE_DIRS ${LUA_VANILLA_INCLUDE_DIRS}) diff --git a/documentation/source/tutorial/all-the-things.rst b/documentation/source/tutorial/all-the-things.rst index 34a36190..4e1c7295 100644 --- a/documentation/source/tutorial/all-the-things.rst +++ b/documentation/source/tutorial/all-the-things.rst @@ -22,7 +22,7 @@ asserts / prerequisites You'll need to ``#include `` somewhere in your code. sol is header-only, so you don't need to compile anything. However, **Lua must be compiled and available**. See the :doc:`getting started tutorial` for more details. -Below, you will see use of a function called ``sol_c_assert``. This is an assert macro that comes with sol2 for the expression purpose of checking things; it's value is immaterial. +Below, you will see use of a function called ``SOL_ASSERT``. This is an assert macro that comes with sol2 for the expression purpose of checking things; it's value is immaterial. diff --git a/examples/interop/LuaBridge/source/LuaBridge.cpp b/examples/interop/LuaBridge/source/LuaBridge.cpp index f9092b3a..e06a73d5 100644 --- a/examples/interop/LuaBridge/source/LuaBridge.cpp +++ b/examples/interop/LuaBridge/source/LuaBridge.cpp @@ -71,7 +71,7 @@ void register_sol_stuff(lua_State* L) { "luabridge-created A { " << from_luabridge.value() << " }" << std::endl; - sol_c_assert(from_luabridge.value() == 24); + SOL_ASSERT(from_luabridge.value() == 24); }, [](A& from_luabridge, int second_arg) { std::cout << "calling 2-argument version with " @@ -79,8 +79,8 @@ void register_sol_stuff(lua_State* L) { << from_luabridge.value() << " } and integer argument of " << second_arg << std::endl; - sol_c_assert(from_luabridge.value() == 24); - sol_c_assert(second_arg == 5); + SOL_ASSERT(from_luabridge.value() == 24); + SOL_ASSERT(second_arg == 5); }); } @@ -88,7 +88,7 @@ void check_with_sol(lua_State* L) { sol::state_view lua(L); A& obj = lua["obj"]; (void)obj; - sol_c_assert(obj.value() == 24); + SOL_ASSERT(obj.value() == 24); } int main(int, char*[]) { @@ -132,4 +132,4 @@ f(obj, 5) -- call 2 argument version check_with_sol(L); return 0; -} \ No newline at end of file +} diff --git a/examples/interop/kaguya/source/kaguya.cpp b/examples/interop/kaguya/source/kaguya.cpp index ff3ffb27..b9e9c0ee 100644 --- a/examples/interop/kaguya/source/kaguya.cpp +++ b/examples/interop/kaguya/source/kaguya.cpp @@ -86,7 +86,7 @@ void register_sol_stuff(lua_State* L) { "kaguya-created ABC { " << from_kaguya.value() << " }" << std::endl; - sol_c_assert(from_kaguya.value() == 24); + SOL_ASSERT(from_kaguya.value() == 24); }, [](ABC& from_kaguya, int second_arg) { std::cout << "calling 2-argument version with " @@ -94,8 +94,8 @@ void register_sol_stuff(lua_State* L) { << from_kaguya.value() << " } and integer argument of " << second_arg << std::endl; - sol_c_assert(from_kaguya.value() == 24); - sol_c_assert(second_arg == 5); + SOL_ASSERT(from_kaguya.value() == 24); + SOL_ASSERT(second_arg == 5); }); } @@ -103,7 +103,7 @@ void check_with_sol(lua_State* L) { sol::state_view lua(L); ABC& obj = lua["obj"]; (void)obj; - sol_c_assert(obj.value() == 24); + SOL_ASSERT(obj.value() == 24); } int main(int, char*[]) { @@ -138,4 +138,4 @@ f(obj, 5) -- call 2 argument version check_with_sol(state.state()); return 0; -} \ No newline at end of file +} diff --git a/examples/interop/luwra/source/luwra.cpp b/examples/interop/luwra/source/luwra.cpp index de6f6740..1f4497b9 100644 --- a/examples/interop/luwra/source/luwra.cpp +++ b/examples/interop/luwra/source/luwra.cpp @@ -83,7 +83,7 @@ void register_sol_stuff(lua_State* L) { "luwra-created ABC { " << from_luwra.value() << " }" << std::endl; - sol_c_assert(from_luwra.value() == 24); + SOL_ASSERT(from_luwra.value() == 24); }, [](ABC& from_luwra, int second_arg) { std::cout << "calling 2-argument version with " @@ -91,8 +91,8 @@ void register_sol_stuff(lua_State* L) { << from_luwra.value() << " } and integer argument of " << second_arg << std::endl; - sol_c_assert(from_luwra.value() == 24); - sol_c_assert(second_arg == 5); + SOL_ASSERT(from_luwra.value() == 24); + SOL_ASSERT(second_arg == 5); }); } @@ -100,7 +100,7 @@ void check_with_sol(lua_State* L) { sol::state_view lua(L); ABC& obj = lua["obj"]; (void)obj; - sol_c_assert(obj.value() == 24); + SOL_ASSERT(obj.value() == 24); } int main(int, char*[]) { @@ -128,4 +128,4 @@ f(obj, 5) -- call 2 argument version check_with_sol(state); return 0; -} \ No newline at end of file +} diff --git a/examples/interop/tolua/source/tolua.cpp b/examples/interop/tolua/source/tolua.cpp index bf1d1d85..b49ea1b9 100644 --- a/examples/interop/tolua/source/tolua.cpp +++ b/examples/interop/tolua/source/tolua.cpp @@ -56,7 +56,7 @@ void register_sol_stuff(lua_State* L) { "tolua-created Player { health:" << from_tolua.getHealth() << " }" << std::endl; - sol_c_assert(from_tolua.getHealth() == 4); + SOL_ASSERT(from_tolua.getHealth() == 4); }, [](Player& from_tolua, int second_arg) { std::cout << "calling 2-argument version with " @@ -64,8 +64,8 @@ void register_sol_stuff(lua_State* L) { << from_tolua.getHealth() << " } and integer argument of " << second_arg << std::endl; - sol_c_assert(from_tolua.getHealth() == 4); - sol_c_assert(second_arg == 5); + SOL_ASSERT(from_tolua.getHealth() == 4); + SOL_ASSERT(second_arg == 5); }); } @@ -73,7 +73,7 @@ void check_with_sol(lua_State* L) { sol::state_view lua(L); Player& obj = lua["obj"]; (void)obj; - sol_c_assert(obj.getHealth() == 4); + SOL_ASSERT(obj.getHealth() == 4); } int main(int, char*[]) { @@ -110,4 +110,4 @@ f(obj, 5) -- call 2 argument version check_with_sol(L); return 0; -} \ No newline at end of file +} diff --git a/examples/require_dll_example/source/require_from_dll.cpp b/examples/require_dll_example/source/require_from_dll.cpp index 1d8f96bb..4ecb8748 100644 --- a/examples/require_dll_example/source/require_from_dll.cpp +++ b/examples/require_dll_example/source/require_from_dll.cpp @@ -27,9 +27,9 @@ print(obj.value))"; std::cout << "Something bad happened: " << err.what() << std::endl; } - sol_c_assert(script_result.valid()); + SOL_ASSERT(script_result.valid()); my_object::test& obj = lua["obj"]; - sol_c_assert(obj.value == 24); + SOL_ASSERT(obj.value == 24); return 0; -} \ No newline at end of file +} diff --git a/examples/source/any_return.cpp b/examples/source/any_return.cpp index 7530effb..cb389231 100644 --- a/examples/source/any_return.cpp +++ b/examples/source/any_return.cpp @@ -30,10 +30,10 @@ int main() { int result = lua["f"](1, 2); // result == 3 - sol_c_assert(result == 3); + SOL_ASSERT(result == 3); double result2 = lua["f"](false, 2.5); // result2 == 2.5 - sol_c_assert(result2 == 2.5); + SOL_ASSERT(result2 == 2.5); // call in Lua, get result // notice we only need 2 arguments here, not 3 @@ -41,7 +41,7 @@ int main() { lua.script("result3 = f(true, 5.5)"); double result3 = lua["result3"]; // result3 == 16.5 - sol_c_assert(result3 == 16.5); + SOL_ASSERT(result3 == 16.5); std::cout << "=== any_return ===" << std::endl; std::cout << "result : " << result << std::endl; @@ -50,4 +50,4 @@ int main() { std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/as_returns.cpp b/examples/source/as_returns.cpp index 421a0618..bfb8a013 100644 --- a/examples/source/as_returns.cpp +++ b/examples/source/as_returns.cpp @@ -21,9 +21,9 @@ int main() { std::string v2 = lua["v2"]; std::string v3 = lua["v3"]; - sol_c_assert(v1 == "arf"); - sol_c_assert(v2 == "bark"); - sol_c_assert(v3 == "woof"); + SOL_ASSERT(v1 == "arf"); + SOL_ASSERT(v2 == "bark"); + SOL_ASSERT(v3 == "woof"); return 0; } diff --git a/examples/source/basic.cpp b/examples/source/basic.cpp index 9b45dc78..a155062b 100644 --- a/examples/source/basic.cpp +++ b/examples/source/basic.cpp @@ -46,7 +46,7 @@ int main() { "appear above this one!" << std::endl; int value = result; - sol_c_assert(value == 24); + SOL_ASSERT(value == 24); } else { std::cout << "the third script failed, check the " @@ -63,7 +63,7 @@ int main() { "wasn't supposed to! Panic!" << std::endl; int value = result; - sol_c_assert(value == 24); + SOL_ASSERT(value == 24); } else { sol::error err = result; diff --git a/examples/source/c_array.cpp b/examples/source/c_array.cpp index 68d1f021..6a535780 100644 --- a/examples/source/c_array.cpp +++ b/examples/source/c_array.cpp @@ -30,10 +30,10 @@ int main() { )"); something& s = lua["s"]; - sol_c_assert(s.arr[0] == 5); - sol_c_assert(s.arr[1] == 6); - sol_c_assert(s.arr[2] == 40); - sol_c_assert(s.arr[3] == 8); + SOL_ASSERT(s.arr[0] == 5); + SOL_ASSERT(s.arr[1] == 6); + SOL_ASSERT(s.arr[2] == 40); + SOL_ASSERT(s.arr[3] == 8); std::string string_array[] = { "first string", @@ -49,7 +49,7 @@ int main() { print(str_arr[3]) )"); - sol_c_assert(string_array[2] == "third string: modified"); + SOL_ASSERT(string_array[2] == "third string: modified"); return 0; } diff --git a/examples/source/c_call.cpp b/examples/source/c_call.cpp index 1e422657..d48560aa 100644 --- a/examples/source/c_call.cpp +++ b/examples/source/c_call.cpp @@ -40,15 +40,15 @@ int main() { // get the results and see // if it worked out int r1 = lua["r1"]; - sol_c_assert(r1 == 32); + SOL_ASSERT(r1 == 32); int r2 = lua["r2"]; - sol_c_assert(r2 == 1); + SOL_ASSERT(r2 == 1); double r3 = lua["r3"]; - sol_c_assert(r3 == 2.5); + SOL_ASSERT(r3 == 2.5); int r4 = lua["r4"]; - sol_c_assert(r4 == 32); + SOL_ASSERT(r4 == 32); int r5 = lua["r5"]; - sol_c_assert(r5 == 1); + SOL_ASSERT(r5 == 1); return 0; } diff --git a/examples/source/config.cpp b/examples/source/config.cpp index 1dcc8d51..a47b2580 100644 --- a/examples/source/config.cpp +++ b/examples/source/config.cpp @@ -31,9 +31,9 @@ height = 1080 screen.name = lua.get("name"); screen.width = lua.get("width"); screen.height = lua.get("height"); - sol_c_assert(screen.name == "Asus"); - sol_c_assert(screen.width == 1920); - sol_c_assert(screen.height == 1080); + SOL_ASSERT(screen.name == "Asus"); + SOL_ASSERT(screen.width == 1920); + SOL_ASSERT(screen.height == 1080); std::cout << "=== config ===" << std::endl; screen.print(); diff --git a/examples/source/container_usertype_as_container.cpp b/examples/source/container_usertype_as_container.cpp index 6f55b40e..3059c289 100644 --- a/examples/source/container_usertype_as_container.cpp +++ b/examples/source/container_usertype_as_container.cpp @@ -80,8 +80,8 @@ print("accumulate after :", ns:accumulate()) number_storage& ns = lua["ns"]; number_storage& ns_container = lua["ns_container"]; - sol_c_assert(&ns == &ns_container); - sol_c_assert(ns.size() == 3); + SOL_ASSERT(&ns == &ns_container); + SOL_ASSERT(ns.size() == 3); std::cout << std::endl; diff --git a/examples/source/containers_as_table.cpp b/examples/source/containers_as_table.cpp index 1a8c9063..9c9e8145 100644 --- a/examples/source/containers_as_table.cpp +++ b/examples/source/containers_as_table.cpp @@ -16,10 +16,10 @@ void demo( src) { std::cout << "demo, sol::nested<...>" << std::endl; const auto& listmap = src.value(); - sol_c_assert(listmap.size() == 2); + SOL_ASSERT(listmap.size() == 2); for (const auto& kvp : listmap) { const std::vector& strings = kvp.second; - sol_c_assert(strings.size() == 3); + SOL_ASSERT(strings.size() == 3); std::cout << "\t" << kvp.first << " = "; for (const auto& s : strings) { std::cout << "'" << s << "'" @@ -46,13 +46,13 @@ void demo_explicit(sol::as_table_t& strings = kvp.second.value(); - sol_c_assert(strings.size() == 3); + SOL_ASSERT(strings.size() == 3); std::cout << "\t" << kvp.first << " = "; for (const auto& s : strings) { std::cout << "'" << s << "'" @@ -85,4 +85,4 @@ g(t) std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/coroutine_state.cpp b/examples/source/coroutine_state.cpp index 0845470e..6e2e894c 100644 --- a/examples/source/coroutine_state.cpp +++ b/examples/source/coroutine_state.cpp @@ -45,7 +45,7 @@ int main(int, char*[]) { transferred_into(); // check int i = lua["i"]; - sol_c_assert(i == 1); + SOL_ASSERT(i == 1); std::cout << std::endl; diff --git a/examples/source/custom_reader.cpp b/examples/source/custom_reader.cpp index d2d88344..90d36fbf 100644 --- a/examples/source/custom_reader.cpp +++ b/examples/source/custom_reader.cpp @@ -91,7 +91,7 @@ int main() { &reader, sol::script_pass_on_error); // make sure we ran loaded and ran the code successfully - sol_c_assert(result.valid()); + SOL_ASSERT(result.valid()); // note there are lua.load( ... ) variants that take a // custom reader than JUST run the code, too! diff --git a/examples/source/customization_convert_on_get.cpp b/examples/source/customization_convert_on_get.cpp index d7b0ed96..9fb311cb 100644 --- a/examples/source/customization_convert_on_get.cpp +++ b/examples/source/customization_convert_on_get.cpp @@ -56,8 +56,8 @@ int main() { number_shim thingsf = lua["vf"]; number_shim thingsg = lua["vg"]; - sol_c_assert(thingsf.num == 25); - sol_c_assert(thingsg.num == 35); + SOL_ASSERT(thingsf.num == 25); + SOL_ASSERT(thingsg.num == 35); return 0; } diff --git a/examples/source/customization_multiple.cpp b/examples/source/customization_multiple.cpp index 193ea8c4..db1e2108 100644 --- a/examples/source/customization_multiple.cpp +++ b/examples/source/customization_multiple.cpp @@ -64,8 +64,8 @@ int main() { sol::function f = lua["f"]; two_things things = f(two_things { 24, false }); - sol_c_assert(things.a == 24); - sol_c_assert(things.b == false); + SOL_ASSERT(things.a == 24); + SOL_ASSERT(things.b == false); // things.a == 24 // things.b == true diff --git a/examples/source/docs/references_in_lambdas.cpp b/examples/source/docs/references_in_lambdas.cpp index 82101449..b3e54d3a 100644 --- a/examples/source/docs/references_in_lambdas.cpp +++ b/examples/source/docs/references_in_lambdas.cpp @@ -20,9 +20,9 @@ int main(int, char*[]) { test& from_lua_t2 = lua["t2"]; // not the same: 'f' lambda copied - sol_c_assert(&from_lua_t1 != &t); + SOL_ASSERT(&from_lua_t1 != &t); // the same: 'g' lambda returned reference - sol_c_assert(&from_lua_t2 == &t); + SOL_ASSERT(&from_lua_t2 == &t); return 0; } diff --git a/examples/source/docs/simple_functions.cpp b/examples/source/docs/simple_functions.cpp index d9921f2a..0eca59a6 100644 --- a/examples/source/docs/simple_functions.cpp +++ b/examples/source/docs/simple_functions.cpp @@ -7,11 +7,11 @@ int main() { int x = 0; lua.set_function("beep", [&x] { ++x; }); lua.script("beep()"); - sol_c_assert(x == 1); + SOL_ASSERT(x == 1); sol::function beep = lua["beep"]; beep(); - sol_c_assert(x == 2); + SOL_ASSERT(x == 2); return 0; } diff --git a/examples/source/docs/simple_structs.cpp b/examples/source/docs/simple_structs.cpp index 8ba4adb5..6bc2b5b7 100644 --- a/examples/source/docs/simple_structs.cpp +++ b/examples/source/docs/simple_structs.cpp @@ -22,10 +22,10 @@ int main() { vars& beep = lua["beep"]; int bopvalue = lua["bopvalue"]; - sol_c_assert(beep.boop == 1); - sol_c_assert(lua.get("beep").boop == 1); - sol_c_assert(beep.bop() == 2); - sol_c_assert(bopvalue == 2); + SOL_ASSERT(beep.boop == 1); + SOL_ASSERT(lua.get("beep").boop == 1); + SOL_ASSERT(beep.bop() == 2); + SOL_ASSERT(bopvalue == 2); return 0; } diff --git a/examples/source/docs/state_transfer.cpp b/examples/source/docs/state_transfer.cpp index af114daa..904eaf8f 100644 --- a/examples/source/docs/state_transfer.cpp +++ b/examples/source/docs/state_transfer.cpp @@ -44,7 +44,7 @@ int main(int, char*[]) { transferred_into(); // check int i = lua["i"]; - sol_c_assert(i == 1); + SOL_ASSERT(i == 1); return 0; } diff --git a/examples/source/dump.cpp b/examples/source/dump.cpp index decb448f..a9091e45 100644 --- a/examples/source/dump.cpp +++ b/examples/source/dump.cpp @@ -22,7 +22,7 @@ int main() { sol::load_result lr = lua.load("a = function (v) print(v) return v end"); // check if it's sucessfully loaded - sol_c_assert(lr.valid()); + SOL_ASSERT(lr.valid()); // turn it into a function, then dump the bytecode sol::protected_function target @@ -34,12 +34,12 @@ int main() { auto result2 = lua2.safe_script( target_bc.as_string_view(), sol::script_pass_on_error); // check if it was done properly - sol_c_assert(result2.valid()); + SOL_ASSERT(result2.valid()); // check in the second state if it was valid sol::protected_function pf = lua2["a"]; int v = pf(25557); - sol_c_assert(v == 25557); + SOL_ASSERT(v == 25557); return 0; -} \ No newline at end of file +} diff --git a/examples/source/dynamic_object.cpp b/examples/source/dynamic_object.cpp index a2a60ae6..006f4c55 100644 --- a/examples/source/dynamic_object.cpp +++ b/examples/source/dynamic_object.cpp @@ -78,11 +78,11 @@ assert(value == 15) // does not work on d1: 'run' wasn't added to d1, only d2 auto script_result = lua.safe_script( "local value = d1:run(5)", sol::script_pass_on_error); - sol_c_assert(!script_result.valid()); + SOL_ASSERT(!script_result.valid()); sol::error err = script_result; std::cout << "received expected error: " << err.what() << std::endl; std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/environments_on_functions.cpp b/examples/source/environments_on_functions.cpp index f434f54a..fde4ba9a 100644 --- a/examples/source/environments_on_functions.cpp +++ b/examples/source/environments_on_functions.cpp @@ -16,11 +16,11 @@ int main(int, char**) { sol::environment env_f(lua, sol::create); env_f["test"] = 31; bool env_f_set_success = sol::set_environment(env_f, f); - sol_c_assert(env_f_set_success); + SOL_ASSERT(env_f_set_success); // the function returns the value from the environment table int result = f(); - sol_c_assert(result == 31); + SOL_ASSERT(result == 31); // You can also protect from variables @@ -30,19 +30,19 @@ int main(int, char**) { sol::environment env_g(lua, sol::create); bool env_g_set_success = env_g.set_on(g); // same as set_environment - sol_c_assert(env_g_set_success); + SOL_ASSERT(env_g_set_success); g(); // the value can be retrieved from the env table int test = env_g["test"]; - sol_c_assert(test == 5); + SOL_ASSERT(test == 5); // the global environment // is not polluted at all, despite both functions being used // and set sol::object global_test = lua["test"]; - sol_c_assert(!global_test.valid()); + SOL_ASSERT(!global_test.valid()); // You can retrieve environments in C++ @@ -62,9 +62,9 @@ int main(int, char**) { int test_target_env = target_env["test"]; // the environment for f the one gotten from // `target` are the same - sol_c_assert(test_env_f == test_target_env); - sol_c_assert(test_env_f == 31); - sol_c_assert(env_f == target_env); + SOL_ASSERT(test_env_f == test_target_env); + SOL_ASSERT(test_env_f == 31); + SOL_ASSERT(env_f == target_env); }); lua.set_function( "check_g_env", [&env_g](sol::function target) { @@ -73,9 +73,9 @@ int main(int, char**) { = sol::get_environment(target); int test_env_g = env_g["test"]; int test_target_env = target_env["test"]; - sol_c_assert(test_env_g == test_target_env); - sol_c_assert(test_env_g == 5); - sol_c_assert(env_g == target_env); + SOL_ASSERT(test_env_g == test_target_env); + SOL_ASSERT(test_env_g == 5); + SOL_ASSERT(env_g == target_env); }); lua.script("check_f_env(f)"); diff --git a/examples/source/exception_handler.cpp b/examples/source/exception_handler.cpp index 78c3f67f..b751eadb 100644 --- a/examples/source/exception_handler.cpp +++ b/examples/source/exception_handler.cpp @@ -50,7 +50,7 @@ int main() { sol::protected_function_result pfr = lua.safe_script( "will_throw()", &sol::script_pass_on_error); - sol_c_assert(!pfr.valid()); + SOL_ASSERT(!pfr.valid()); sol::error err = pfr; std::cout << err.what() << std::endl; diff --git a/examples/source/functions.cpp b/examples/source/functions.cpp index 05070f2b..9a1db832 100644 --- a/examples/source/functions.cpp +++ b/examples/source/functions.cpp @@ -46,7 +46,7 @@ int main() { // calling a stateful lambda modifies the value lua.script("inc()"); - sol_c_assert(x == 10); + SOL_ASSERT(x == 10); if (x == 10) { // Do something based on this information std::cout << "Yahoo! x is " << x << std::endl; @@ -58,7 +58,7 @@ inc() inc() inc() )"); - sol_c_assert(x == 40); + SOL_ASSERT(x == 40); if (x == 40) { // Do something based on this information std::cout << "Yahoo! x is " << x << std::endl; @@ -70,8 +70,8 @@ inc() int value = add(10, 11); // second way to call the function int value2 = add.call(10, 11); - sol_c_assert(value == 21); - sol_c_assert(value2 == 21); + SOL_ASSERT(value == 21); + SOL_ASSERT(value2 == 21); if (value == 21 && value2 == 21) { std::cout << "Woo, value is 21!" << std::endl; } @@ -79,4 +79,4 @@ inc() std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/index_and_newindex_usertype.cpp b/examples/source/index_and_newindex_usertype.cpp index bd830c24..9de25a6f 100644 --- a/examples/source/index_and_newindex_usertype.cpp +++ b/examples/source/index_and_newindex_usertype.cpp @@ -39,9 +39,9 @@ int main() { "print(v[2])\n"); vector& v = lua["v"]; - sol_c_assert(v[0] == 0.0); - sol_c_assert(v[1] == 0.0); - sol_c_assert(v[2] == 3.0); + SOL_ASSERT(v[0] == 0.0); + SOL_ASSERT(v[1] == 0.0); + SOL_ASSERT(v[2] == 3.0); return 0; } diff --git a/examples/source/indirect_function_calls.cpp b/examples/source/indirect_function_calls.cpp index 3e25baa9..ca396f4a 100644 --- a/examples/source/indirect_function_calls.cpp +++ b/examples/source/indirect_function_calls.cpp @@ -69,8 +69,8 @@ end int subtract_result = lua["subtract_result"]; int add_result = lua["add_result"]; - sol_c_assert(add_result == 6); - sol_c_assert(subtract_result == 4); + SOL_ASSERT(add_result == 6); + SOL_ASSERT(subtract_result == 4); std::cout << std::endl; return 0; diff --git a/examples/source/metatable_key_low_level.cpp b/examples/source/metatable_key_low_level.cpp index 37620d4a..6bfb2a96 100644 --- a/examples/source/metatable_key_low_level.cpp +++ b/examples/source/metatable_key_low_level.cpp @@ -28,7 +28,7 @@ int main(int, char*[]) { int result1 = b_as_function(1); // pass 'self' directly to argument int result2 = b_call(b, 1); - sol_c_assert(result1 == result2); - sol_c_assert(result1 == 1); - sol_c_assert(result2 == 1); + SOL_ASSERT(result1 == result2); + SOL_ASSERT(result1 == 1); + SOL_ASSERT(result2 == 1); } diff --git a/examples/source/multi_results.cpp b/examples/source/multi_results.cpp index 12241bee..f216cb1d 100644 --- a/examples/source/multi_results.cpp +++ b/examples/source/multi_results.cpp @@ -28,8 +28,8 @@ int main() { sol::tie(first, second) = multi(); // use the values - sol_c_assert(first == 10); - sol_c_assert(second == "goodbye"); + SOL_ASSERT(first == 10); + SOL_ASSERT(second == "goodbye"); // sol::as_returns // works with any iterable, @@ -48,9 +48,9 @@ int main() { int b = lua["b"]; int c = lua["c"]; - sol_c_assert(a == 55); - sol_c_assert(b == 66); - sol_c_assert(c == 77); + SOL_ASSERT(a == 55); + SOL_ASSERT(b == 66); + SOL_ASSERT(c == 77); // sol::variadic_results // you can push objects of different types @@ -74,9 +74,9 @@ int main() { bool u = lua["u"]; std::string v = lua["v"]; - sol_c_assert(t == 42); - sol_c_assert(u); - sol_c_assert(v == "awoo"); + SOL_ASSERT(t == 42); + SOL_ASSERT(u); + SOL_ASSERT(v == "awoo"); return 0; -} \ No newline at end of file +} diff --git a/examples/source/overloading_with_members.cpp b/examples/source/overloading_with_members.cpp index 48dee3d7..c15d1357 100644 --- a/examples/source/overloading_with_members.cpp +++ b/examples/source/overloading_with_members.cpp @@ -60,8 +60,8 @@ int main() { pup& barker = lua["barker"]; std::cout << barker.barks << std::endl; - sol_c_assert(barker.barks == 22); + SOL_ASSERT(barker.barks == 22); std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/protect.cpp b/examples/source/protect.cpp index 18c6e79c..517609d6 100644 --- a/examples/source/protect.cpp +++ b/examples/source/protect.cpp @@ -20,7 +20,7 @@ int main(int, char*[]) { value = pcall(pm.gen,"wrong argument") )__"); bool value = lua["value"]; - sol_c_assert(!value); + SOL_ASSERT(!value); return 0; } diff --git a/examples/source/require.cpp b/examples/source/require.cpp index a661ae3a..3bb5bf69 100644 --- a/examples/source/require.cpp +++ b/examples/source/require.cpp @@ -44,10 +44,10 @@ s.bark = 20 )"); some_class& s = lua["s"]; - sol_c_assert(s.bark == 20); + SOL_ASSERT(s.bark == 20); std::cout << "s.bark = " << s.bark << std::endl; std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/require_override_behavior.cpp b/examples/source/require_override_behavior.cpp index e6e44bfa..77467544 100644 --- a/examples/source/require_override_behavior.cpp +++ b/examples/source/require_override_behavior.cpp @@ -55,7 +55,7 @@ int main() { print(test) )", sol::script_pass_on_error); - sol_c_assert(a_result.valid()); + SOL_ASSERT(a_result.valid()); try { // this will always fail auto b_result = lua.safe_script(R"( @@ -65,7 +65,7 @@ int main() { sol::script_throw_on_error); // this will not be executed because of the throw, // but it better be true regardless! - sol_c_assert(!b_result.valid()); + SOL_ASSERT(!b_result.valid()); } catch (const std::exception& ex) { // Whenever sol2 throws an exception from panic, diff --git a/examples/source/runtime_additions.cpp b/examples/source/runtime_additions.cpp index 8fc322e3..68a995a1 100644 --- a/examples/source/runtime_additions.cpp +++ b/examples/source/runtime_additions.cpp @@ -34,7 +34,7 @@ obj:print() )"); object& obj = lua["obj"]; - sol_c_assert(obj.value == 1); + SOL_ASSERT(obj.value == 1); return 0; } diff --git a/examples/source/script_error_handling.cpp b/examples/source/script_error_handling.cpp index a06c64c9..76f0cb65 100644 --- a/examples/source/script_error_handling.cpp +++ b/examples/source/script_error_handling.cpp @@ -28,7 +28,7 @@ return 24 code, sol::script_default_on_error); // This will never be reached std::cout << value << std::endl; - sol_c_assert(value == 24); + SOL_ASSERT(value == 24); } catch (const sol::error& err) { std::cout << "Something went horribly wrong: " @@ -46,7 +46,7 @@ return 24 { sol::protected_function_result result = lua.script(code, sol::script_pass_on_error); - sol_c_assert(!result.valid()); + SOL_ASSERT(!result.valid()); if (!result.valid()) { sol::error err = result; sol::call_status status = result.status(); @@ -65,7 +65,7 @@ return 24 // any errors The two previous approaches are recommended { sol::load_result loaded_chunk = lua.load(code); - sol_c_assert(!loaded_chunk.valid()); + SOL_ASSERT(!loaded_chunk.valid()); if (!loaded_chunk.valid()) { sol::error err = loaded_chunk; sol::load_status status = loaded_chunk.status(); @@ -77,7 +77,7 @@ return 24 else { // Because the syntax is bad, this will never be // reached - sol_c_assert(false); + SOL_ASSERT(false); // If there is a runtime error (lua GC memory // error, nil access, etc.) it will be caught here sol::protected_function script_func diff --git a/examples/source/self_from_lua.cpp b/examples/source/self_from_lua.cpp index ff95d831..6adbec9a 100644 --- a/examples/source/self_from_lua.cpp +++ b/examples/source/self_from_lua.cpp @@ -19,7 +19,7 @@ int main() { // definitely the same thing& self = selfobj.as(); - sol_c_assert(&self == this); + SOL_ASSERT(&self == this); } void func(sol::this_state ts) const { @@ -32,7 +32,7 @@ int main() { thing& self = selfobj.as(); // definitely the same - sol_c_assert(&self == this); + SOL_ASSERT(&self == this); } }; diff --git a/examples/source/shared_ptr.cpp b/examples/source/shared_ptr.cpp index 4d992d52..659583f9 100644 --- a/examples/source/shared_ptr.cpp +++ b/examples/source/shared_ptr.cpp @@ -72,18 +72,18 @@ int main() { << ref_to_shared_ptr.use_count() << std::endl; - sol_c_assert( + SOL_ASSERT( ptr_to_my_type == ref_to_shared_ptr.get()); - sol_c_assert( + SOL_ASSERT( &ref_to_my_type == ref_to_shared_ptr.get()); - sol_c_assert(ref_to_shared_ptr->value == 10); + SOL_ASSERT(ref_to_shared_ptr->value == 10); // script affects all of them equally lua.script("shared.value = 20"); - sol_c_assert(ptr_to_my_type->value == 20); - sol_c_assert(ref_to_my_type.value == 20); - sol_c_assert(ref_to_shared_ptr->value == 20); + SOL_ASSERT(ptr_to_my_type->value == 20); + SOL_ASSERT(ref_to_my_type.value == 20); + SOL_ASSERT(ref_to_shared_ptr->value == 20); } { std::cout << "getting copy of shared_ptr..." @@ -98,15 +98,15 @@ int main() { << copy_of_shared_ptr.use_count() << std::endl; - sol_c_assert(copy_of_shared_ptr->value == 20); - sol_c_assert(copy_of_value.value == 20); + SOL_ASSERT(copy_of_shared_ptr->value == 20); + SOL_ASSERT(copy_of_value.value == 20); // script still affects pointer, but does not affect // copy of `my_type` lua.script("shared.value = 30"); - sol_c_assert(copy_of_shared_ptr->value == 30); - sol_c_assert(copy_of_value.value == 20); + SOL_ASSERT(copy_of_shared_ptr->value == 30); + SOL_ASSERT(copy_of_value.value == 20); } // set to nil and collect garbage to destroy it lua.script("shared = nil"); diff --git a/examples/source/shared_ptr_inheritance.cpp b/examples/source/shared_ptr_inheritance.cpp index a4cc22fe..2c3a484c 100644 --- a/examples/source/shared_ptr_inheritance.cpp +++ b/examples/source/shared_ptr_inheritance.cpp @@ -55,7 +55,7 @@ int main() { sol::protected_function_result result = lua.safe_script( "inspect_shape_table({shape=Box.new()})"); - sol_c_assert(result.valid()); + SOL_ASSERT(result.valid()); return 0; } diff --git a/examples/source/stack_aligned_function.cpp b/examples/source/stack_aligned_function.cpp index 423a77ff..ccd58eea 100644 --- a/examples/source/stack_aligned_function.cpp +++ b/examples/source/stack_aligned_function.cpp @@ -26,8 +26,8 @@ int main(int, char*[]) { int result = func(sol::stack_count(2)); // make sure everything is clean - sol_c_assert(result == 22); - sol_c_assert( + SOL_ASSERT(result == 22); + SOL_ASSERT( lua.stack_top() == 0); // stack is empty/balanced return 0; diff --git a/examples/source/stack_aligned_stack_handler_function.cpp b/examples/source/stack_aligned_stack_handler_function.cpp index 5ea58ed0..49cccd51 100644 --- a/examples/source/stack_aligned_stack_handler_function.cpp +++ b/examples/source/stack_aligned_stack_handler_function.cpp @@ -40,8 +40,8 @@ int main(int, char*[]) { traceback_handler.pop(); // make sure everything is clean - sol_c_assert(result == 22); - sol_c_assert( + SOL_ASSERT(result == 22); + SOL_ASSERT( lua.stack_top() == 0); // stack is empty/balanced return 0; diff --git a/examples/source/static_variables.cpp b/examples/source/static_variables.cpp index 3cfcfef4..16d26597 100644 --- a/examples/source/static_variables.cpp +++ b/examples/source/static_variables.cpp @@ -24,15 +24,15 @@ int main() { int direct_value = lua["test"]["direct"]; // direct_value == 2 - sol_c_assert(direct_value == 2); + SOL_ASSERT(direct_value == 2); std::cout << "direct_value: " << direct_value << std::endl; int global = lua["test"]["global"]; int global2 = lua["test"]["ref_global"]; // global == 25 // global2 == 25 - sol_c_assert(global == 25); - sol_c_assert(global2 == 25); + SOL_ASSERT(global == 25); + SOL_ASSERT(global2 == 25); std::cout << "First round of values --" << std::endl; std::cout << global << std::endl; @@ -51,8 +51,8 @@ int main() { // if muh_variable goes out of scope or is deleted // problems could arise, so be careful! - sol_c_assert(global == 25); - sol_c_assert(global2 == 542); + SOL_ASSERT(global == 25); + SOL_ASSERT(global2 == 542); std::cout << "Second round of values --" << std::endl; std::cout << "global : " << global << std::endl; diff --git a/examples/source/table_as_container.cpp b/examples/source/table_as_container.cpp index efb37896..e82bfe2b 100644 --- a/examples/source/table_as_container.cpp +++ b/examples/source/table_as_container.cpp @@ -27,11 +27,11 @@ int main() { "vectors = { Vector.new(3, 6), Vector.new(6, 3) }"); auto vectors = lua["vectors"].get>(); - sol_c_assert(vectors[0].x == 3); - sol_c_assert(vectors[0].y == 6); + SOL_ASSERT(vectors[0].x == 3); + SOL_ASSERT(vectors[0].y == 6); - sol_c_assert(vectors[1].x == 6); - sol_c_assert(vectors[1].y == 3); + SOL_ASSERT(vectors[1].x == 6); + SOL_ASSERT(vectors[1].y == 3); return 0; } diff --git a/examples/source/table_create_if_nil.cpp b/examples/source/table_create_if_nil.cpp index 4e7c3e98..8a04bd48 100644 --- a/examples/source/table_create_if_nil.cpp +++ b/examples/source/table_create_if_nil.cpp @@ -26,7 +26,7 @@ int main(int, char*[]) { auto result = lua.safe_script(code, sol::script_pass_on_error); // did not work - sol_c_assert(!result.valid()); + SOL_ASSERT(!result.valid()); // create values create_namespace_sf(lua); @@ -34,7 +34,7 @@ int main(int, char*[]) { auto result2 = lua.safe_script(code, sol::script_pass_on_error); // it worked properly - sol_c_assert(result2.valid()); + SOL_ASSERT(result2.valid()); std::cout << std::endl; diff --git a/examples/source/table_proxy.cpp b/examples/source/table_proxy.cpp index a2f5d747..bf49a976 100644 --- a/examples/source/table_proxy.cpp +++ b/examples/source/table_proxy.cpp @@ -27,14 +27,14 @@ int main() { // retrivies value inside of lua table above std::string value = z; - sol_c_assert(value == "arf!"); + SOL_ASSERT(value == "arf!"); // Can change the value later... z = 20; // Yay, lazy-evaluation! int changed_value = z; // now it's 20! - sol_c_assert(changed_value == 20); + SOL_ASSERT(changed_value == 20); lua.script("assert(bark.woof[2] == 20)"); lua["a_new_value"] = 24; diff --git a/examples/source/this_state.cpp b/examples/source/this_state.cpp index b7f79b9b..011aadd1 100644 --- a/examples/source/this_state.cpp +++ b/examples/source/this_state.cpp @@ -23,9 +23,9 @@ int main() { lua.script("second = bark(2, 2)"); // only takes 2 arguments int first = lua["first"]; - sol_c_assert(first == 6); + SOL_ASSERT(first == 6); int second = lua["second"]; - sol_c_assert(second == 6); + SOL_ASSERT(second == 6); return 0; -} \ No newline at end of file +} diff --git a/examples/source/tie.cpp b/examples/source/tie.cpp index 3f9aa1df..9083ca7c 100644 --- a/examples/source/tie.cpp +++ b/examples/source/tie.cpp @@ -18,21 +18,21 @@ int main(int, char*[]) { sol::function woof = lua["woof"]; double numwoof = woof(20); - sol_c_assert(numwoof == 55.0); + SOL_ASSERT(numwoof == 55.0); lua.script("function f () return 10, 11, 12 end"); sol::function f = lua["f"]; std::tuple abc = f(); - sol_c_assert(std::get<0>(abc) == 10); - sol_c_assert(std::get<1>(abc) == 11); - sol_c_assert(std::get<2>(abc) == 12); + SOL_ASSERT(std::get<0>(abc) == 10); + SOL_ASSERT(std::get<1>(abc) == 11); + SOL_ASSERT(std::get<2>(abc) == 12); // or int a, b, c; sol::tie(a, b, c) = f(); - sol_c_assert(a == 10); - sol_c_assert(b == 11); - sol_c_assert(c == 12); + SOL_ASSERT(a == 10); + SOL_ASSERT(b == 11); + SOL_ASSERT(c == 12); return 0; } diff --git a/examples/source/tutorials/multiple_return.cpp b/examples/source/tutorials/multiple_return.cpp index 5711549e..9fff9104 100644 --- a/examples/source/tutorials/multiple_return.cpp +++ b/examples/source/tutorials/multiple_return.cpp @@ -8,15 +8,15 @@ int main() { std::tuple result; result = lua["f"](1, 2, 3); - sol_c_assert(result == std::make_tuple(1, 2, 3)); + SOL_ASSERT(result == std::make_tuple(1, 2, 3)); int a, b; std::string c; // NOTE: sol::tie, NOT std::tie // (ESS OH ELL prefix, not ESS TEE DEE prefix) sol::tie(a, b, c) = lua["f"](1, 2, "bark"); - sol_c_assert(a == 1); - sol_c_assert(b == 2); - sol_c_assert(c == "bark"); + SOL_ASSERT(a == 1); + SOL_ASSERT(b == 2); + SOL_ASSERT(c == "bark"); return 0; } diff --git a/examples/source/tutorials/quick_n_dirty/functions_easy.cpp b/examples/source/tutorials/quick_n_dirty/functions_easy.cpp index 5f0a8b5b..940eee58 100644 --- a/examples/source/tutorials/quick_n_dirty/functions_easy.cpp +++ b/examples/source/tutorials/quick_n_dirty/functions_easy.cpp @@ -18,15 +18,15 @@ int main(int, char*[]) { = fx; int is_one = stdfx(1, 34.5, 3, "bark"); - sol_c_assert(is_one == 1); + SOL_ASSERT(is_one == 1); int is_also_one = fx(1, "boop", 3, "bark"); - sol_c_assert(is_also_one == 1); + SOL_ASSERT(is_also_one == 1); // call through operator[] int is_three = lua["g"](1, 2); - sol_c_assert(is_three == 3); + SOL_ASSERT(is_three == 3); double is_4_8 = lua["g"](2.4, 2.4); - sol_c_assert(is_4_8 == 4.8); + SOL_ASSERT(is_4_8 == 4.8); return 0; } diff --git a/examples/source/tutorials/quick_n_dirty/multiple_returns_from_lua.cpp b/examples/source/tutorials/quick_n_dirty/multiple_returns_from_lua.cpp index a3494e1e..8af9827a 100644 --- a/examples/source/tutorials/quick_n_dirty/multiple_returns_from_lua.cpp +++ b/examples/source/tutorials/quick_n_dirty/multiple_returns_from_lua.cpp @@ -14,9 +14,9 @@ int main(int, char*[]) { int b; std::string c; sol::tie(a, b, c) = lua["f"](100, 200, "bark"); - sol_c_assert(a == 100); - sol_c_assert(b == 200); - sol_c_assert(c == "bark"); + SOL_ASSERT(a == 100); + SOL_ASSERT(b == 200); + SOL_ASSERT(c == "bark"); return 0; } diff --git a/examples/source/tutorials/quick_n_dirty/multiple_returns_to_lua.cpp b/examples/source/tutorials/quick_n_dirty/multiple_returns_to_lua.cpp index 98719851..950a2d5c 100644 --- a/examples/source/tutorials/quick_n_dirty/multiple_returns_to_lua.cpp +++ b/examples/source/tutorials/quick_n_dirty/multiple_returns_to_lua.cpp @@ -14,20 +14,20 @@ int main(int, char*[]) { std::tuple result = lua["f"](100, 200, 300); const std::tuple expected(100, 200, 300); - sol_c_assert(result == expected); + SOL_ASSERT(result == expected); std::tuple result2; result2 = lua["f"](100, 200, "BARK BARK BARK!"); const std::tuple expected2( 100, 200, "BARK BARK BARK!"); - sol_c_assert(result2 == expected2); + SOL_ASSERT(result2 == expected2); int a, b; std::string c; sol::tie(a, b, c) = lua["f"](100, 200, "bark"); - sol_c_assert(a == 100); - sol_c_assert(b == 200); - sol_c_assert(c == "bark"); + SOL_ASSERT(a == 100); + SOL_ASSERT(b == 200); + SOL_ASSERT(c == "bark"); lua.script(R"( a, b, c = f(150, 250, "woofbark") diff --git a/examples/source/tutorials/quick_n_dirty/namespacing.cpp b/examples/source/tutorials/quick_n_dirty/namespacing.cpp index 86b44001..3b9d22b1 100644 --- a/examples/source/tutorials/quick_n_dirty/namespacing.cpp +++ b/examples/source/tutorials/quick_n_dirty/namespacing.cpp @@ -51,7 +51,7 @@ int main() { // calling this function also works lua.script("bark.print_my_class(obj)"); my_class& obj = lua["obj"]; - sol_c_assert(obj.b == 25); + SOL_ASSERT(obj.b == 25); std::cout << std::endl; diff --git a/examples/source/tutorials/quick_n_dirty/running_lua_code.cpp b/examples/source/tutorials/quick_n_dirty/running_lua_code.cpp index 6ea0aba8..f4229a6e 100644 --- a/examples/source/tutorials/quick_n_dirty/running_lua_code.cpp +++ b/examples/source/tutorials/quick_n_dirty/running_lua_code.cpp @@ -22,7 +22,7 @@ int main(int, char*[]) { // run a script, get the result int value = lua.script("return 54"); - sol_c_assert(value == 54); + SOL_ASSERT(value == 54); auto bad_code_result = lua.script("123 herp.derp", [](lua_State*, sol::protected_function_result pfr) { @@ -34,7 +34,7 @@ int main(int, char*[]) { return pfr; }); // it did not work - sol_c_assert(!bad_code_result.valid()); + SOL_ASSERT(!bad_code_result.valid()); // the default handler panics or throws, depending on your // settings uncomment for explosions: auto bad_code_result_2 diff --git a/examples/source/tutorials/quick_n_dirty/running_lua_code_low_level.cpp b/examples/source/tutorials/quick_n_dirty/running_lua_code_low_level.cpp index dcf56536..97e07249 100644 --- a/examples/source/tutorials/quick_n_dirty/running_lua_code_low_level.cpp +++ b/examples/source/tutorials/quick_n_dirty/running_lua_code_low_level.cpp @@ -38,7 +38,7 @@ int main(int, char*[]) { sol::load_result script3 = lua.load("return 24"); // execute, get return value int value2 = script3(); - sol_c_assert(value2 == 24); + SOL_ASSERT(value2 == 24); std::cout << std::endl; diff --git a/examples/source/tutorials/quick_n_dirty/running_lua_code_safely.cpp b/examples/source/tutorials/quick_n_dirty/running_lua_code_safely.cpp index 7e639cad..78c4d199 100644 --- a/examples/source/tutorials/quick_n_dirty/running_lua_code_safely.cpp +++ b/examples/source/tutorials/quick_n_dirty/running_lua_code_safely.cpp @@ -42,12 +42,12 @@ int main(int, char*[]) { // run a script, get the result sol::optional maybe_value = lua.safe_script( "return 54", sol::script_pass_on_error); - sol_c_assert(maybe_value.has_value()); - sol_c_assert(*maybe_value == 54); + SOL_ASSERT(maybe_value.has_value()); + SOL_ASSERT(*maybe_value == 54); auto bad_code_result = lua.safe_script( "123 herp.derp", sol::script_pass_on_error); - sol_c_assert(!bad_code_result.valid()); + SOL_ASSERT(!bad_code_result.valid()); // you can also specify a handler function, and it'll // properly work here @@ -61,7 +61,7 @@ int main(int, char*[]) { return pfr; }); // it did not work - sol_c_assert(!bad_code_result2.valid()); + SOL_ASSERT(!bad_code_result2.valid()); // the default handler panics or throws, depending on your // settings uncomment for explosions: auto bad_code_result_2 diff --git a/examples/source/tutorials/quick_n_dirty/set_and_get_variables.cpp b/examples/source/tutorials/quick_n_dirty/set_and_get_variables.cpp index e9bb561f..89452f0d 100644 --- a/examples/source/tutorials/quick_n_dirty/set_and_get_variables.cpp +++ b/examples/source/tutorials/quick_n_dirty/set_and_get_variables.cpp @@ -44,40 +44,40 @@ int main(int, char*[]) { // implicit conversion int number = lua["number"]; - sol_c_assert(number == 24); + SOL_ASSERT(number == 24); // explicit get auto number2 = lua.get("number2"); - sol_c_assert(number2 == 24.5); + SOL_ASSERT(number2 == 24.5); // strings too std::string important_string = lua["important_string"]; - sol_c_assert(important_string == "woof woof"); + SOL_ASSERT(important_string == "woof woof"); // dig into a table int value = lua["some_table"]["value"]; - sol_c_assert(value == 24); + SOL_ASSERT(value == 24); // get a function sol::function a_function = lua["a_function"]; int value_is_100 = a_function(); // convertible to std::function std::function a_std_function = a_function; int value_is_still_100 = a_std_function(); - sol_c_assert(value_is_100 == 100); - sol_c_assert(value_is_still_100 == 100); + SOL_ASSERT(value_is_100 == 100); + SOL_ASSERT(value_is_still_100 == 100); sol::object number_obj = lua.get("number"); // sol::type::number sol::type t1 = number_obj.get_type(); - sol_c_assert(t1 == sol::type::number); + SOL_ASSERT(t1 == sol::type::number); sol::object function_obj = lua["a_function"]; // sol::type::function sol::type t2 = function_obj.get_type(); - sol_c_assert(t2 == sol::type::function); + SOL_ASSERT(t2 == sol::type::function); bool is_it_really = function_obj.is>(); - sol_c_assert(is_it_really); + SOL_ASSERT(is_it_really); // will not contain data sol::optional check_for_me = lua["a_function"]; - sol_c_assert(check_for_me == sol::nullopt); + SOL_ASSERT(check_for_me == sol::nullopt); return 0; } diff --git a/examples/source/tutorials/quick_n_dirty/set_and_get_variables_exists.cpp b/examples/source/tutorials/quick_n_dirty/set_and_get_variables_exists.cpp index 26a05d71..f684173b 100644 --- a/examples/source/tutorials/quick_n_dirty/set_and_get_variables_exists.cpp +++ b/examples/source/tutorials/quick_n_dirty/set_and_get_variables_exists.cpp @@ -9,11 +9,11 @@ int main(int, char*[]) { lua.script("exists = 250"); int first_try = lua.get_or("exists", 322); - sol_c_assert(first_try == 250); + SOL_ASSERT(first_try == 250); lua.set("exists", sol::lua_nil); int second_try = lua.get_or("exists", 322); - sol_c_assert(second_try == 322); + SOL_ASSERT(second_try == 322); return 0; } diff --git a/examples/source/tutorials/quick_n_dirty/tables_and_nesting.cpp b/examples/source/tutorials/quick_n_dirty/tables_and_nesting.cpp index 20dbab04..b5046cf8 100644 --- a/examples/source/tutorials/quick_n_dirty/tables_and_nesting.cpp +++ b/examples/source/tutorials/quick_n_dirty/tables_and_nesting.cpp @@ -23,21 +23,21 @@ int main(int, char*[]) { int bark1 = def["ghi"]["bark"]; int bark2 = lua["def"]["ghi"]["bark"]; - sol_c_assert(bark1 == 50); - sol_c_assert(bark2 == 50); + SOL_ASSERT(bark1 == 50); + SOL_ASSERT(bark2 == 50); int abcval1 = abc[0]; int abcval2 = ghi["woof"][0]; - sol_c_assert(abcval1 == 24); - sol_c_assert(abcval2 == 24); + SOL_ASSERT(abcval1 == 24); + SOL_ASSERT(abcval2 == 24); sol::optional will_not_error = lua["abc"]["DOESNOTEXIST"]["ghi"]; - sol_c_assert(will_not_error == sol::nullopt); + SOL_ASSERT(will_not_error == sol::nullopt); int also_will_not_error = lua["abc"]["def"]["ghi"]["jklm"].get_or(25); - sol_c_assert(also_will_not_error == 25); + SOL_ASSERT(also_will_not_error == 25); // if you don't go safe, // will throw (or do at_panic if no exceptions) diff --git a/examples/source/tutorials/quick_n_dirty/userdata.cpp b/examples/source/tutorials/quick_n_dirty/userdata.cpp index 6520d8c9..2dd43dde 100644 --- a/examples/source/tutorials/quick_n_dirty/userdata.cpp +++ b/examples/source/tutorials/quick_n_dirty/userdata.cpp @@ -52,11 +52,11 @@ int main(int, char*[]) { Doge& lua_dog_move = lua["dog_move"]; Doge& lua_dog_unique_ptr = lua["dog_unique_ptr"]; Doge& lua_dog_shared_ptr = lua["dog_shared_ptr"]; - sol_c_assert(lua_dog.tailwag == 50); - sol_c_assert(lua_dog_copy.tailwag == 30); - sol_c_assert(lua_dog_move.tailwag == 30); - sol_c_assert(lua_dog_unique_ptr.tailwag == 25); - sol_c_assert(lua_dog_shared_ptr.tailwag == 31); + SOL_ASSERT(lua_dog.tailwag == 50); + SOL_ASSERT(lua_dog_copy.tailwag == 30); + SOL_ASSERT(lua_dog_move.tailwag == 30); + SOL_ASSERT(lua_dog_unique_ptr.tailwag == 25); + SOL_ASSERT(lua_dog_shared_ptr.tailwag == 31); // lua will treat these types as opaque, and you will be // able to pass them around to C++ functions and Lua diff --git a/examples/source/tutorials/reading_functions.cpp b/examples/source/tutorials/reading_functions.cpp index 58044970..9a054315 100644 --- a/examples/source/tutorials/reading_functions.cpp +++ b/examples/source/tutorials/reading_functions.cpp @@ -13,17 +13,17 @@ int main() { // Get and immediately call int x = lua["f"](30); - sol_c_assert(x == 35); + SOL_ASSERT(x == 35); // Store it into a variable first, then call sol::unsafe_function f = lua["f"]; int y = f(20); - sol_c_assert(y == 25); + SOL_ASSERT(y == 25); // Store it into a variable first, then call sol::protected_function safe_f = lua["f"]; int z = safe_f(45); - sol_c_assert(z == 50); + SOL_ASSERT(z == 50); return 0; } diff --git a/examples/source/tutorials/variables_demo.cpp b/examples/source/tutorials/variables_demo.cpp index 4e1e0b3c..aca8599f 100644 --- a/examples/source/tutorials/variables_demo.cpp +++ b/examples/source/tutorials/variables_demo.cpp @@ -22,7 +22,7 @@ config = { = lua["config"] ["fullscreen"]; // can get nested variables sol::table config = lua["config"]; - sol_c_assert(!isfullscreen); + SOL_ASSERT(!isfullscreen); // can also get it using the "get" member function // auto replaces the unqualified type name @@ -32,8 +32,8 @@ config = { // too std::tuple xyresolutiontuple = resolution.get("x", "y"); - sol_c_assert(std::get<0>(xyresolutiontuple) == 1024); - sol_c_assert(std::get<1>(xyresolutiontuple) == 768); + SOL_ASSERT(std::get<0>(xyresolutiontuple) == 1024); + SOL_ASSERT(std::get<1>(xyresolutiontuple) == 768); // test variable auto bark = lua["config"]["bark"]; @@ -68,12 +68,12 @@ config = { // (it tries to get a number, and fullscreen is // not a number int is_defaulted = lua["config"]["fullscreen"].get_or(24); - sol_c_assert(is_defaulted == 24); + SOL_ASSERT(is_defaulted == 24); // This will result in the value of the config, which is // 'false' bool is_not_defaulted = lua["config"]["fullscreen"]; - sol_c_assert(!is_not_defaulted); + SOL_ASSERT(!is_not_defaulted); return 0; } diff --git a/examples/source/tutorials/writing_functions.cpp b/examples/source/tutorials/writing_functions.cpp index 78a70cdb..2653e97e 100644 --- a/examples/source/tutorials/writing_functions.cpp +++ b/examples/source/tutorials/writing_functions.cpp @@ -22,7 +22,7 @@ int main() { // Read out the global variable we stored in 'some_str' in // the quick lua code we just executed std::string some_str = lua["some_str"]; - sol_c_assert(some_str == "DaD"); + SOL_ASSERT(some_str == "DaD"); return 0; } diff --git a/examples/source/tutorials/writing_overloaded_template_functions.cpp b/examples/source/tutorials/writing_overloaded_template_functions.cpp index ba85ffca..b8a3b289 100644 --- a/examples/source/tutorials/writing_overloaded_template_functions.cpp +++ b/examples/source/tutorials/writing_overloaded_template_functions.cpp @@ -22,8 +22,8 @@ int main() { "my_str = my_combine('bark bark', ' woof woof')"); int my_num = lua["my_num"]; std::string my_str = lua["my_str"]; - sol_c_assert(my_num == 3); - sol_c_assert(my_str == "bark bark woof woof"); + SOL_ASSERT(my_num == 3); + SOL_ASSERT(my_str == "bark bark woof woof"); return 0; } diff --git a/examples/source/tutorials/writing_template_functions.cpp b/examples/source/tutorials/writing_template_functions.cpp index 00d7bc2b..5644aca3 100644 --- a/examples/source/tutorials/writing_template_functions.cpp +++ b/examples/source/tutorials/writing_template_functions.cpp @@ -21,13 +21,13 @@ int main() { lua.script("my_num = my_int_add(1, 2)"); int my_num = lua["my_num"]; - sol_c_assert(my_num == 3); + SOL_ASSERT(my_num == 3); lua.script( "my_str = my_string_combine('bark bark', ' woof " "woof')"); std::string my_str = lua["my_str"]; - sol_c_assert(my_str == "bark bark woof woof"); + SOL_ASSERT(my_str == "bark bark woof woof"); return 0; } diff --git a/examples/source/unique_ptr.cpp b/examples/source/unique_ptr.cpp index f9be1f2d..598c3fe2 100644 --- a/examples/source/unique_ptr.cpp +++ b/examples/source/unique_ptr.cpp @@ -63,31 +63,31 @@ int main() { my_type& ref_to_my_type = lua["unique"]; my_type* ptr_to_my_type = lua["unique"]; - sol_c_assert( + SOL_ASSERT( ptr_to_my_type == ref_to_unique_ptr.get()); - sol_c_assert( + SOL_ASSERT( &ref_to_my_type == ref_to_unique_ptr.get()); - sol_c_assert(ref_to_unique_ptr->value == 10); + SOL_ASSERT(ref_to_unique_ptr->value == 10); // script affects all of them equally lua.script("unique.value = 20"); - sol_c_assert(ptr_to_my_type->value == 20); - sol_c_assert(ref_to_my_type.value == 20); - sol_c_assert(ref_to_unique_ptr->value == 20); + SOL_ASSERT(ptr_to_my_type->value == 20); + SOL_ASSERT(ref_to_my_type.value == 20); + SOL_ASSERT(ref_to_unique_ptr->value == 20); } { std::cout << "getting copy of unique_ptr..." << std::endl; my_type copy_of_value = lua["unique"]; - sol_c_assert(copy_of_value.value == 20); + SOL_ASSERT(copy_of_value.value == 20); // script still affects pointer, but does not affect // copy of `my_type` lua.script("unique.value = 30"); - sol_c_assert(copy_of_value.value == 20); + SOL_ASSERT(copy_of_value.value == 20); } // set to nil and collect garbage to destroy it lua.script("unique = nil"); diff --git a/examples/source/usertype_bitfields.cpp b/examples/source/usertype_bitfields.cpp index 7edf75a7..a522edab 100644 --- a/examples/source/usertype_bitfields.cpp +++ b/examples/source/usertype_bitfields.cpp @@ -200,9 +200,9 @@ int main() { std::cout << "N: " << N << std::endl; std::cout << "D: " << D << std::endl; - sol_c_assert(C); - sol_c_assert(N); - sol_c_assert(D == 0xDF); + SOL_ASSERT(C); + SOL_ASSERT(N); + SOL_ASSERT(D == 0xDF); std::cout << std::endl; diff --git a/examples/source/usertype_dynamic_get_set.cpp b/examples/source/usertype_dynamic_get_set.cpp index dc73e29f..9e2afdfe 100644 --- a/examples/source/usertype_dynamic_get_set.cpp +++ b/examples/source/usertype_dynamic_get_set.cpp @@ -162,8 +162,8 @@ int main() { sol::userdata v1 = lua["v1"]; double v1x = v1["x"]; double v1y = v1["y"]; - sol_c_assert(v1x == 1.000); - sol_c_assert(v1y == 0.000); + SOL_ASSERT(v1x == 1.000); + SOL_ASSERT(v1y == 0.000); v1[0] = 2.000; lua.script(R"( @@ -175,4 +175,4 @@ int main() { std::cout << std::endl; return 0; -} \ No newline at end of file +} diff --git a/examples/source/usertype_initializers.cpp b/examples/source/usertype_initializers.cpp index f8c4375a..e153087f 100644 --- a/examples/source/usertype_initializers.cpp +++ b/examples/source/usertype_initializers.cpp @@ -72,8 +72,8 @@ print('h2.data is ' .. h2.data) )"); holy& h1 = lua["h1"]; holy& h2 = lua["h2"]; - sol_c_assert(h1.data == 50); - sol_c_assert(h2.data == 0); + SOL_ASSERT(h1.data == 50); + SOL_ASSERT(h2.data == 0); } std::cout << std::endl; -} \ No newline at end of file +} diff --git a/examples/source/usertype_special_functions.cpp b/examples/source/usertype_special_functions.cpp index faa01260..22504ba0 100644 --- a/examples/source/usertype_special_functions.cpp +++ b/examples/source/usertype_special_functions.cpp @@ -65,8 +65,8 @@ int main() { vec& a1 = lua["a1"]; vec& s1 = lua["s1"]; - sol_c_assert(a1.x == 1 && a1.y == 1); - sol_c_assert(s1.x == 1 && s1.y == -1); + SOL_ASSERT(a1.x == 1 && a1.y == 1); + SOL_ASSERT(s1.x == 1 && s1.y == -1); lua["a2"] = lua["a1"]; @@ -75,4 +75,4 @@ int main() { )"); return 0; -} \ No newline at end of file +} diff --git a/examples/source/usertype_var.cpp b/examples/source/usertype_var.cpp index 22ed7522..34bf66b3 100644 --- a/examples/source/usertype_var.cpp +++ b/examples/source/usertype_var.cpp @@ -21,26 +21,26 @@ int main() { sol::var(std::ref(test::number))); int direct_value = lua["test"]["direct"]; - sol_c_assert(direct_value == 2); + SOL_ASSERT(direct_value == 2); int number = lua["test"]["number"]; - sol_c_assert(number == 25); + SOL_ASSERT(number == 25); int ref_number = lua["test"]["ref_number"]; - sol_c_assert(ref_number == 25); + SOL_ASSERT(ref_number == 25); test::number = 542; // number is its own memory: was passed by value // So does not change int number_again = lua["test"]["number"]; - sol_c_assert(number_again == 25); + SOL_ASSERT(number_again == 25); // ref_number is just test::number // passed through std::ref // so, it holds a reference // which can be updated int ref_number_again = lua["test"]["ref_number"]; - sol_c_assert(ref_number_again == 542); + SOL_ASSERT(ref_number_again == 542); // be careful about referencing local variables, // if they go out of scope but are still reference // you'll suffer dangling reference bugs! diff --git a/include/sol/assert.hpp b/include/sol/assert.hpp index 97fdfdbe..7f27905d 100644 --- a/include/sol/assert.hpp +++ b/include/sol/assert.hpp @@ -43,15 +43,15 @@ struct pre_main { // clang-format off -#if SOL_IS_ON(SOL_USER_C_ASSERT) - #define sol_c_assert(...) SOL_C_ASSERT(__VA_ARGS__) +#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_c_assert(...) \ + #define SOL_ASSERT(...) \ do { \ if (!(__VA_ARGS__)) { \ std::cerr << "Assertion `" #__VA_ARGS__ "` failed in " << __FILE__ << " line " << __LINE__ << std::endl; \ @@ -59,7 +59,7 @@ struct pre_main { } \ } while (false) #else - #define sol_c_assert(...) \ + #define SOL_ASSERT(...) \ do { \ if (false) { \ (void)(__VA_ARGS__); \ @@ -68,15 +68,15 @@ struct pre_main { #endif #endif -#if SOL_IS_ON(SOL_USER_M_ASSERT) - #define sol_m_assert(message, ...) SOL_M_ASSERT(message, __VA_ARGS__) +#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_m_assert(message, ...) \ + #define SOL_ASSERT_MSG(message, ...) \ do { \ if (!(__VA_ARGS__)) { \ std::cerr << "Assertion `" #__VA_ARGS__ "` failed in " << __FILE__ << " line " << __LINE__ << ": " << message << std::endl; \ @@ -84,7 +84,7 @@ struct pre_main { } \ } while (false) #else - #define sol_m_assert(message, ...) \ + #define SOL_ASSERT_MSG(message, ...) \ do { \ if (false) { \ (void)(__VA_ARGS__); \ diff --git a/include/sol/compatibility/lua_version.hpp b/include/sol/compatibility/lua_version.hpp index b0bf1e45..41cfc54e 100644 --- a/include/sol/compatibility/lua_version.hpp +++ b/include/sol/compatibility/lua_version.hpp @@ -21,8 +21,8 @@ // 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_COMPATIBILITY_VERSION_HPP -#define SOL_COMPATIBILITY_VERSION_HPP +#ifndef SOL_COMPATIBILITY_LUA_VERSION_HPP +#define SOL_COMPATIBILITY_LUA_VERSION_HPP #include @@ -215,4 +215,4 @@ // clang-format on -#endif // SOL_COMPATIBILITY_VERSION_HPP +#endif // SOL_COMPATIBILITY_LUA_VERSION_HPP diff --git a/include/sol/stack.hpp b/include/sol/stack.hpp index 00ebb826..fb1cf3b0 100644 --- a/include/sol/stack.hpp +++ b/include/sol/stack.hpp @@ -205,7 +205,7 @@ namespace sol { template void raw_table_set(lua_State* L, T&& arg, int tableindex = -2) { int push_count = push(L, std::forward(arg)); - sol_c_assert(push_count == 1); + SOL_ASSERT(push_count == 1); std::size_t unique_index = static_cast(luaL_len(L, tableindex) + 1u); lua_rawseti(L, tableindex, static_cast(unique_index)); } @@ -215,7 +215,7 @@ namespace sol { template int set_ref(lua_State* L, T&& arg, int tableindex = -2) { int push_count = push(L, std::forward(arg)); - sol_c_assert(push_count == 1); + SOL_ASSERT(push_count == 1); return luaL_ref(L, tableindex); } diff --git a/include/sol/stack/detail/pairs.hpp b/include/sol/stack/detail/pairs.hpp index c913a748..a27828ff 100644 --- a/include/sol/stack/detail/pairs.hpp +++ b/include/sol/stack/detail/pairs.hpp @@ -84,7 +84,7 @@ namespace sol { namespace stack { namespace stack_detail { pushed += 1; } int metatable_exists = lua_getmetatable(L_, 1); - sol_c_assert(metatable_exists == 1); + SOL_ASSERT(metatable_exists == 1); const auto& index_key = to_string(sol::meta_function::index); lua_getfield(L_, lua_gettop(L_), index_key.c_str()); lua_remove(L_, -2); diff --git a/include/sol/stack_check_unqualified.hpp b/include/sol/stack_check_unqualified.hpp index 4bf75626..f0aaa011 100644 --- a/include/sol/stack_check_unqualified.hpp +++ b/include/sol/stack_check_unqualified.hpp @@ -579,6 +579,105 @@ namespace sol { namespace stack { } }; + template + struct unqualified_checker, expect> { + template + static bool check_two(types, lua_State* arg_L, int index, type indextype, Handler&& handler, record& tracking) { + tracking.use(1); + +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) + luaL_checkstack(arg_L, 3, detail::not_enough_stack_space_generic); +#endif // make sure stack doesn't overflow + + int index = lua_absindex(arg_L, relindex); + lua_pushnil(arg_L); + while (lua_next(arg_L, index) != 0) { + const bool is_key_okay = stack::check(arg_L, -2, std::forward(handler), tracking); + if (!is_key_okay) { + lua_pop(arg_L, 2); + return false; + } + const bool is_value_okay = stack::check(arg_L, -1, std::forward(handler), tracking); + if (!is_value_okay) { + lua_pop(arg_L, 2); + return false; + } + lua_pop(arg_L, 1); + } + return true; + } + + template + static bool check_one(types, lua_State* arg_L, int relindex, type indextype, Handler&& handler, record& tracking) { + tracking.use(1); + + size_t index = lua_absindex(arg_L, relindex); + // Zzzz slower but necessary thanks to the lower version API and missing functions qq + std::size_t idx = 0; + int vi = 0; + for (lua_Integer i = 0;; (void)(i += lua_size::value), lua_pop(arg_L, static_cast(vi))) { + vi = 0; + if (idx >= N) { + return true; + } +#if SOL_IS_ON(SOL_SAFE_STACK_CHECK) + luaL_checkstack(arg_L, 2, detail::not_enough_stack_space_generic); +#endif // make sure stack doesn't overflow + bool isnil = false; + for (; vi < static_cast(lua_size::value); ++vi) { + lua_pushinteger(arg_L, i); + lua_gettable(arg_L, static_cast(index)); + type vt = type_of(arg_L, -1); + isnil = vt == type::lua_nil; + if (isnil) { + if (i == 0) { + vi += 1; + goto loop_continue; + } + lua_pop(arg_L, static_cast(vi + 1)); + return true; + } + } + if (!stack::check(arg_L, -lua_size::value, std::forward(handler), tracking)) { + lua_pop(arg_L, lua_size::value); + return false; + } + ++idx; + loop_continue:; + } + return true; + } + + template + static bool check(lua_State* arg_L, int index, Handler&& handler, record& tracking) { + using Tu = meta::unqualified_t; + if constexpr (is_container_v) { + if constexpr (meta::is_associative::value) { + typedef typename Tu::value_type P; + typedef typename P::first_type K; + typedef typename P::second_type V; + return check_two(types(), arg_L, index, expect, std::forward(handler), tracking); + } + else { + typedef typename Tu::value_type V; + return check_one(types(), arg_L, index, expect, std::forward(handler), tracking); + } + } + else { + unqualified_checker c {}; + return c.check(arg_L, index, std::forward(handler), tracking); + } + } + }; + + template + struct unqualified_checker, expect> { + template + static bool check(lua_State* arg_L, int index, Handler&& handler, record& tracking) { + return stack::check(arg_L, index, std::forward(handler), tracking); + } + }; + template struct unqualified_checker, type::poly> { template diff --git a/include/sol/stack_get_unqualified.hpp b/include/sol/stack_get_unqualified.hpp index d8d5a122..e7731138 100644 --- a/include/sol/stack_get_unqualified.hpp +++ b/include/sol/stack_get_unqualified.hpp @@ -24,6 +24,8 @@ #ifndef SOL_STACK_UNQUALIFIED_GET_HPP #define SOL_STACK_UNQUALIFIED_GET_HPP +#include + #include #include #include @@ -184,10 +186,10 @@ namespace sol { namespace stack { struct qualified_getter { static decltype(auto) get(lua_State* L, int index, record& tracking) { using Tu = meta::unqualified_t; - static constexpr bool is_userdata_of_some_kind + static constexpr bool is_maybe_userdata_of_some_kind = !std::is_reference_v< X> && is_container_v && std::is_default_constructible_v && !is_lua_primitive_v && !is_transparent_argument_v; - if constexpr (is_userdata_of_some_kind) { + if constexpr (is_maybe_userdata_of_some_kind) { if (type_of(L, index) == type::userdata) { return static_cast(stack_detail::unchecked_unqualified_get(L, index, tracking)); } @@ -578,20 +580,20 @@ namespace sol { namespace stack { using Tu = meta::unqualified_t; if constexpr (is_container_v) { if constexpr (meta::is_associative::value) { - typedef typename T::value_type P; + typedef typename Tu::value_type P; typedef typename P::first_type K; typedef typename P::second_type V; - unqualified_getter> g{}; + unqualified_getter> g {}; return g.get(types>(), L, index, tracking); } else { - typedef typename T::value_type V; - unqualified_getter> g{}; + typedef typename Tu::value_type V; + unqualified_getter> g {}; return g.get(types>(), L, index, tracking); } } else { - unqualified_getter g{}; + unqualified_getter g {}; return g.get(L, index, tracking); } } @@ -611,6 +613,20 @@ namespace sol { namespace stack { } }; + template + struct unqualified_getter> { + static decltype(auto) get(lua_State* arg_L, int index, record& tracking) { + return stack::get(arg_L, index, tracking); + } + }; + + template + struct unqualified_getter> { + static decltype(auto) get(lua_State* arg_L, int index, record& tracking) { + return stack::get(arg_L, index, tracking); + } + }; + template <> struct unqualified_getter { static userdata_value get(lua_State* L, int index, record& tracking) { diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 8036896e..16feced5 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -145,7 +145,7 @@ namespace sol { namespace stack { lua_State* target_L = target.lua_state(); int target_index = absolute_index(target_L, -target.push()); int env_count = push_environment_of(target_L, target_index); - sol_c_assert(env_count == 1); + SOL_ASSERT(env_count == 1); lua_rotate(target_L, target_index, 1); lua_pop(target_L, 1); return env_count; @@ -323,7 +323,7 @@ namespace sol { namespace stack { if (static_cast(llround(static_cast(value))) != value) { #if SOL_IS_OFF(SOL_EXCEPTIONS) // Is this really worth it? - sol_m_assert(false, "integer value will be misrepresented in lua"); + SOL_ASSERT_MSG(false, "integer value will be misrepresented in lua"); lua_pushinteger(L, static_cast(value)); return 1; #else diff --git a/include/sol/types.hpp b/include/sol/types.hpp index d54523d4..9fd300ec 100644 --- a/include/sol/types.hpp +++ b/include/sol/types.hpp @@ -466,6 +466,63 @@ namespace sol { return as_container_t(std::forward(value)); } + template + struct exhaustive_until : private detail::ebco { + private: + using base_t = detail::ebco; + + public: + using base_t::base_t; + + using base_t::value; + + operator std::add_pointer_t>() { + return std::addressof(this->base_t::value()); + } + + operator std::add_pointer_t>>() const { + return std::addressof(this->base_t::value()); + } + + operator std::add_lvalue_reference_t() { + return this->base_t::value(); + } + + operator std::add_const_t>&() const { + return this->base_t::value(); + } + }; + + template + using exhaustive = exhaustive_until::max()>; + + template + struct non_exhaustive : private detail::ebco { + private: + using base_t = detail::ebco; + + public: + using base_t::base_t; + + using base_t::value; + + operator std::add_pointer_t>() { + return std::addressof(this->base_t::value()); + } + + operator std::add_pointer_t>>() const { + return std::addressof(this->base_t::value()); + } + + operator std::add_lvalue_reference_t() { + return this->base_t::value(); + } + + operator std::add_const_t>&() const { + return this->base_t::value(); + } + }; + template struct push_invoke_t : private detail::ebco { private: @@ -1194,12 +1251,14 @@ namespace sol { } // namespace detail template - struct is_lua_primitive - : std::integral_constant || ((type::userdata == lua_type_of_v)&&meta::meta_detail::has_internal_marker_v> && !meta::meta_detail::has_internal_marker_v>) - || is_lua_reference_or_proxy_v || meta::is_specialization_of_v || meta::is_specialization_of_v> { }; + struct is_lua_primitive : std::integral_constant // cf + || ((type::userdata == lua_type_of_v) // cf + &&meta::meta_detail::has_internal_marker_v> // cf + && !meta::meta_detail::has_internal_marker_v>) // cf + || is_lua_reference_or_proxy_v // cf + || meta::is_specialization_of_v // cf + || meta::is_specialization_of_v> { }; template constexpr inline bool is_lua_primitive_v = is_lua_primitive::value; diff --git a/include/sol/version.hpp b/include/sol/version.hpp index ae002e1d..b16f2951 100644 --- a/include/sol/version.hpp +++ b/include/sol/version.hpp @@ -760,6 +760,16 @@ #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_DEFAULT_OFF #endif +#if defined(SOL_CONTAINER_CHECK_IS_EXHAUSTIVE) + #if (SOL_CONTAINER_CHECK_IS_EXHAUSTIVE != 0) + #define SOL_CONTAINER_CHECK_IS_EXHAUSTIVE_I_ SOL_ON + #else + #define SOL_CONTAINER_CHECK_IS_EXHAUSTIVE_I_ SOL_OFF + #endif +#else + #define SOL_CONTAINER_CHECK_IS_EXHAUSTIVE_I_ SOL_DEFAULT_OFF +#endif + #if defined(SOL_FUNCTION_CALL_VALUE_SEMANTICS) #if (SOL_FUNCTION_CALL_VALUE_SEMANTICS != 0) #define SOL_FUNCTION_CALL_VALUE_SEMANTICS_I_ SOL_ON @@ -820,16 +830,16 @@ #define SOL2_CI_I_ SOL_DEFAULT_OFF #endif -#if defined(SOL_C_ASSERT) - #define SOL_USER_C_ASSERT_I_ SOL_ON +#if defined(SOL_ASSERT) + #define SOL_USER_ASSERT_I_ SOL_ON #else - #define SOL_USER_C_ASSERT_I_ SOL_DEFAULT_OFF + #define SOL_USER_ASSERT_I_ SOL_DEFAULT_OFF #endif -#if defined(SOL_M_ASSERT) - #define SOL_USER_M_ASSERT_I_ SOL_ON +#if defined(SOL_ASSERT_MSG) + #define SOL_USER_ASSERT_MSG_I_ SOL_ON #else - #define SOL_USER_M_ASSERT_I_ SOL_DEFAULT_OFF + #define SOL_USER_ASSERT_MSG_I_ SOL_DEFAULT_OFF #endif #include diff --git a/tests/container_exhaustive/CMakeLists.txt b/tests/container_exhaustive/CMakeLists.txt new file mode 100644 index 00000000..c060ecc3 --- /dev/null +++ b/tests/container_exhaustive/CMakeLists.txt @@ -0,0 +1,34 @@ +# # # # 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. + +# # # # sol2 tests - environment + +file(GLOB sources + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) + +sol2_create_basic_test(sol2.tests.container_exhaustive sol2::sol2 ${sources}) +sol2_create_basic_test(sol2.tests.container_exhaustive.SOL_ALL_SAFETIES_ON sol2::sol2 ${sources}) +target_compile_definitions(sol2.tests.container_exhaustive.SOL_ALL_SAFETIES_ON + PRIVATE + SOL_ALL_SAFETIES_ON=1) diff --git a/tests/container_exhaustive/source/exhaustive.cpp b/tests/container_exhaustive/source/exhaustive.cpp new file mode 100644 index 00000000..b5fcf9c2 --- /dev/null +++ b/tests/container_exhaustive/source/exhaustive.cpp @@ -0,0 +1,110 @@ +// 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. + +#include + +#include + +#include +#include + +inline namespace sol2_tests_exhaustive { + struct Link { + int value; + }; + + struct NonLink { + void* value; + }; + + inline constexpr int FAILURE_CONSTANT = 1000; + + inline int ex_f0(sol::exhaustive> ex_vec) { + const auto& vec = ex_vec.value(); + for (const auto& elem : vec) { + REQUIRE(elem.value == 0); + } + return 0; + } + + inline int ex_f1(sol::exhaustive> ex_vec) { + const auto& vec = ex_vec.value(); + for (std::size_t i = 0; i < vec.size(); ++i) { + const auto& elem = vec[i]; + REQUIRE(elem == static_cast(i + 1)); + } + return 1; + } + + inline int ex_f2(sol::exhaustive> ex_vec) { + const auto& vec = ex_vec.value(); + for (const auto& elem : vec) { + REQUIRE(elem.value == nullptr); + } + return 2; + } + + inline int ex_ffail(sol::object o) { + REQUIRE(o.get_type() == sol::type::table); + return FAILURE_CONSTANT; + } +} // namespace sol2_tests_exhaustive + +TEST_CASE("large_integer/bool", "pass bool integral value to and from lua") { + sol::state lua; + lua.open_libraries(sol::lib::base); + + lua["FAILURE_CONSTANT"] = FAILURE_CONSTANT; + lua["link_obj"] = Link { 0 }; + lua["nonlink_obj"] = NonLink { nullptr }; + + sol::optional setup_result = lua.safe_script(R"( + expect0_0 = { link_obj, link_obj, link_obj, link_obj } + expect0_1 = { link_obj, 2, 3, 4 } + expect1_0 = { 1, 2, 3, 4, 5 } + expect1_1 = { 1, link_obj, 3, 4, 5 } + expect2_0 = { nonlink_obj, nonlink_obj, nonlink_obj, nonlink_obj } + expect2_1 = { nonlink_obj, 2, 3, 4, 5 } + )"); + REQUIRE_FALSE(setup_result.has_value()); + + lua.set_function("get_table_exhaustive", sol::overload(ex_f0, ex_f1, ex_f2, ex_ffail)); + + sol::optional result = lua.safe_script(R"( + result0_0 = get_table_exhaustive(expect0_0) + assert(result0_0 == 0) + result0_1 = get_table_exhaustive(expect0_1) + assert(result0_1 == FAILURE_CONSTANT) + + result1_0 = get_table_exhaustive(expect1_0) + assert(result1_0 == 1) + result1_1 = get_table_exhaustive(expect1_1) + assert(result1_1 == FAILURE_CONSTANT) + + result2_0 = get_table_exhaustive(expect2_0) + assert(result2_0 == 2) + result2_1 = get_table_exhaustive(expect2_1) + assert(result2_1 == FAILURE_CONSTANT) + )"); + REQUIRE_FALSE(result.has_value()); +} diff --git a/tests/container_exhaustive/source/main.cpp b/tests/container_exhaustive/source/main.cpp new file mode 100644 index 00000000..0f13865b --- /dev/null +++ b/tests/container_exhaustive/source/main.cpp @@ -0,0 +1,30 @@ +// 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. + +#define CATCH_CONFIG_RUNNER +#include + +int main(int argc, char* argv[]) { + int result = Catch::Session().run(argc, argv); + return result; +} diff --git a/tests/run_time/CMakeLists.txt b/tests/run_time/CMakeLists.txt index b2bbfbd6..5f4503a8 100644 --- a/tests/run_time/CMakeLists.txt +++ b/tests/run_time/CMakeLists.txt @@ -22,16 +22,20 @@ # # # # sol2 tests - runtime tests -file(GLOB sources - LIST_DIRECTORIES FALSE - CONFIGURE_DEPENDS - source/*.cpp) +if (SOL2_BROKEN_TESTS) -sol2_create_basic_test(sol2.tests.run_time sol2::sol2 ${sources}) -target_compile_definitions(sol2.tests.run_time PRIVATE - SOL_ALL_SAFETIES_ON=1) -if (SOL2_TESTS_SINGLE) - sol2_create_basic_test(sol2.single.tests.run_time sol2::sol2::single ${sources}) - target_compile_definitions(sol2.single.tests.run_time PRIVATE + file(GLOB sources + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) + + sol2_create_basic_test(sol2.tests.run_time sol2::sol2 ${sources}) + target_compile_definitions(sol2.tests.run_time PRIVATE SOL_ALL_SAFETIES_ON=1) + if (SOL2_TESTS_SINGLE) + sol2_create_basic_test(sol2.single.tests.run_time sol2::sol2::single ${sources}) + target_compile_definitions(sol2.single.tests.run_time PRIVATE + SOL_ALL_SAFETIES_ON=1) + endif() + endif() diff --git a/tests/utility/CMakeLists.txt b/tests/utility/CMakeLists.txt new file mode 100644 index 00000000..c060ecc3 --- /dev/null +++ b/tests/utility/CMakeLists.txt @@ -0,0 +1,34 @@ +# # # # 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. + +# # # # sol2 tests - environment + +file(GLOB sources + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + source/*.cpp) + +sol2_create_basic_test(sol2.tests.container_exhaustive sol2::sol2 ${sources}) +sol2_create_basic_test(sol2.tests.container_exhaustive.SOL_ALL_SAFETIES_ON sol2::sol2 ${sources}) +target_compile_definitions(sol2.tests.container_exhaustive.SOL_ALL_SAFETIES_ON + PRIVATE + SOL_ALL_SAFETIES_ON=1) diff --git a/tests/run_time/source/is_integer.cpp b/tests/utility/source/is_integer.cpp similarity index 97% rename from tests/run_time/source/is_integer.cpp rename to tests/utility/source/is_integer.cpp index 78300fc8..a8e29b9e 100644 --- a/tests/run_time/source/is_integer.cpp +++ b/tests/utility/source/is_integer.cpp @@ -1,53 +1,53 @@ -// 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. - - -#include "sol_test.hpp" - -#include -#include -#include - -#include - -TEST_CASE("is_integer") { - sol::state lua; - - SECTION("non-numeric type") { - auto object = sol::make_object(lua, "Hello"); - CHECK(!sol::utility::is_integer(object)); - CHECK(!sol::utility::is_integer(sol::stack_object(lua, -1))); - } - - SECTION("floating point") { - auto object = sol::make_object(lua, 5.5); - CHECK(!sol::utility::is_integer(object)); - CHECK(!sol::utility::is_integer(sol::stack_object(lua, -1))); - } - - SECTION("integer") { - auto object = sol::make_object(lua, 5); - CHECK(sol::utility::is_integer(object)); - CHECK(sol::utility::is_integer(sol::stack_object(lua, -1))); - } -} +// 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. + + +#include "sol_test.hpp" + +#include +#include +#include + +#include + +TEST_CASE("is_integer") { + sol::state lua; + + SECTION("non-numeric type") { + auto object = sol::make_object(lua, "Hello"); + CHECK(!sol::utility::is_integer(object)); + CHECK(!sol::utility::is_integer(sol::stack_object(lua, -1))); + } + + SECTION("floating point") { + auto object = sol::make_object(lua, 5.5); + CHECK(!sol::utility::is_integer(object)); + CHECK(!sol::utility::is_integer(sol::stack_object(lua, -1))); + } + + SECTION("integer") { + auto object = sol::make_object(lua, 5); + CHECK(sol::utility::is_integer(object)); + CHECK(sol::utility::is_integer(sol::stack_object(lua, -1))); + } +} diff --git a/tests/utility/source/main.cpp b/tests/utility/source/main.cpp new file mode 100644 index 00000000..0f13865b --- /dev/null +++ b/tests/utility/source/main.cpp @@ -0,0 +1,30 @@ +// 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. + +#define CATCH_CONFIG_RUNNER +#include + +int main(int argc, char* argv[]) { + int result = Catch::Session().run(argc, argv); + return result; +} diff --git a/tests/run_time/source/to_string.cpp b/tests/utility/source/to_string.cpp similarity index 100% rename from tests/run_time/source/to_string.cpp rename to tests/utility/source/to_string.cpp From f81643aa0c0c507c0cd8400b8cfedc74a34a19f6 Mon Sep 17 00:00:00 2001 From: ShepherdSoasis Date: Wed, 9 Nov 2022 18:22:56 -0500 Subject: [PATCH 27/53] =?UTF-8?q?=F0=9F=9B=A0=20Fix=20exhaustive=20checkin?= =?UTF-8?q?g=20compilation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/source/docs/std_thread.cpp | 2 +- include/sol/stack_check_unqualified.hpp | 2 +- include/sol/types.hpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/source/docs/std_thread.cpp b/examples/source/docs/std_thread.cpp index 3c15f80b..6b8a30c2 100644 --- a/examples/source/docs/std_thread.cpp +++ b/examples/source/docs/std_thread.cpp @@ -23,7 +23,7 @@ struct worker_data { }; void worker_thread(worker_data& data) { - for (std::uint64_t loops = 0; true; ++loops) { + for ([[maybe_unused]] std::uint64_t loops = 0; true; ++loops) { // Wait until main() sends data std::unique_lock data_lock( data.until_ready_mutex); diff --git a/include/sol/stack_check_unqualified.hpp b/include/sol/stack_check_unqualified.hpp index f0aaa011..37c220bb 100644 --- a/include/sol/stack_check_unqualified.hpp +++ b/include/sol/stack_check_unqualified.hpp @@ -582,7 +582,7 @@ namespace sol { namespace stack { template struct unqualified_checker, expect> { template - static bool check_two(types, lua_State* arg_L, int index, type indextype, Handler&& handler, record& tracking) { + static bool check_two(types, lua_State* arg_L, int relindex, type indextype, Handler&& handler, record& tracking) { tracking.use(1); #if SOL_IS_ON(SOL_SAFE_STACK_CHECK) diff --git a/include/sol/types.hpp b/include/sol/types.hpp index 9fd300ec..204516a2 100644 --- a/include/sol/types.hpp +++ b/include/sol/types.hpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #if SOL_IS_ON(SOL_STD_VARIANT) @@ -494,7 +495,7 @@ namespace sol { }; template - using exhaustive = exhaustive_until::max()>; + using exhaustive = exhaustive_until::max)()>; template struct non_exhaustive : private detail::ebco { From 973e1c3cd6d14b8daf1745c7cbeddf610bd50fd0 Mon Sep 17 00:00:00 2001 From: ShepherdSoasis Date: Wed, 4 Jan 2023 15:35:32 -0500 Subject: [PATCH 28/53] =?UTF-8?q?=F0=9F=9B=A0=20Review=20exhaustive=20chec?= =?UTF-8?q?k=20and=20get=20rid=20of=20a=20few=20Wall/pedwarn=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/sol/stack_check_unqualified.hpp | 3 +- include/sol/stack_core.hpp | 8 +-- include/sol/table_proxy.hpp | 13 +++- tests/CMakeLists.txt | 1 + .../source/exhaustive.cpp | 60 ++++++++++++------- 5 files changed, 54 insertions(+), 31 deletions(-) diff --git a/include/sol/stack_check_unqualified.hpp b/include/sol/stack_check_unqualified.hpp index 37c220bb..0c87d9a0 100644 --- a/include/sol/stack_check_unqualified.hpp +++ b/include/sol/stack_check_unqualified.hpp @@ -608,7 +608,7 @@ namespace sol { namespace stack { } template - static bool check_one(types, lua_State* arg_L, int relindex, type indextype, Handler&& handler, record& tracking) { + static bool check_one(types, lua_State* arg_L, int relindex, type, Handler&& handler, record& tracking) { tracking.use(1); size_t index = lua_absindex(arg_L, relindex); @@ -645,7 +645,6 @@ namespace sol { namespace stack { ++idx; loop_continue:; } - return true; } template diff --git a/include/sol/stack_core.hpp b/include/sol/stack_core.hpp index a037c5b8..c4f5e203 100644 --- a/include/sol/stack_core.hpp +++ b/include/sol/stack_core.hpp @@ -370,10 +370,10 @@ namespace sol { constexpr std::size_t initial_size = aligned_space_for(); - void* pointer_adjusted; - void* dx_adjusted; - void* id_adjusted; - void* data_adjusted; + void* pointer_adjusted = nullptr; + void* dx_adjusted = nullptr; + void* id_adjusted = nullptr; + void* data_adjusted = nullptr; bool result = attempt_alloc_unique(L, std::alignment_of_v, sizeof(T*), diff --git a/include/sol/table_proxy.hpp b/include/sol/table_proxy.hpp index 1cb1e9de..13c9006f 100644 --- a/include/sol/table_proxy.hpp +++ b/include/sol/table_proxy.hpp @@ -77,6 +77,15 @@ namespace sol { table_proxy(Table table, T&& k) : tbl(table), key(std::forward(k)) { } + table_proxy(const table_proxy&) = default; + table_proxy(table_proxy&&) = default; + table_proxy& operator=(const table_proxy& right) { + return set(right); + } + table_proxy& operator=(table_proxy&& right) { + return set(std::move(right)); + } + template table_proxy& set(T&& item) & { tuple_set(std::make_index_sequence>>(), std::forward(item)); @@ -101,7 +110,7 @@ namespace sol { return std::move(*this); } - template + template , table_proxy>>* = nullptr> table_proxy& operator=(T&& other) & { using Tu = meta::unwrap_unqualified_t; if constexpr (!is_lua_reference_or_proxy_v && meta::is_invocable_v) { @@ -112,7 +121,7 @@ namespace sol { } } - template + template , table_proxy>>* = nullptr> table_proxy&& operator=(T&& other) && { using Tu = meta::unwrap_unqualified_t; if constexpr (!is_lua_reference_or_proxy_v && meta::is_invocable_v && !detail::is_msvc_callable_rigged_v) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f727763b..e08a7b49 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -83,6 +83,7 @@ function(sol2_create_basic_test test_target_name target_sol) endfunction() add_subdirectory(inclusion) +add_subdirectory(container_exhaustive) add_subdirectory(enum) add_subdirectory(environment) add_subdirectory(exceptions) diff --git a/tests/container_exhaustive/source/exhaustive.cpp b/tests/container_exhaustive/source/exhaustive.cpp index b5fcf9c2..36b489a4 100644 --- a/tests/container_exhaustive/source/exhaustive.cpp +++ b/tests/container_exhaustive/source/exhaustive.cpp @@ -39,10 +39,12 @@ inline namespace sol2_tests_exhaustive { inline constexpr int FAILURE_CONSTANT = 1000; + inline constexpr int LINK_CONSTANT = 0xA837; + inline int ex_f0(sol::exhaustive> ex_vec) { const auto& vec = ex_vec.value(); for (const auto& elem : vec) { - REQUIRE(elem.value == 0); + REQUIRE(elem.value == LINK_CONSTANT); } return 0; } @@ -56,10 +58,11 @@ inline namespace sol2_tests_exhaustive { return 1; } - inline int ex_f2(sol::exhaustive> ex_vec) { + inline int ex_f2(sol::exhaustive> ex_vec, sol::this_state this_lua) { const auto& vec = ex_vec.value(); + void* address = static_cast(this_lua.lua_state()); for (const auto& elem : vec) { - REQUIRE(elem.value == nullptr); + REQUIRE(elem.value == address); } return 2; } @@ -74,9 +77,11 @@ TEST_CASE("large_integer/bool", "pass bool integral value to and from lua") { sol::state lua; lua.open_libraries(sol::lib::base); + void* address = lua.lua_state(); + lua["FAILURE_CONSTANT"] = FAILURE_CONSTANT; - lua["link_obj"] = Link { 0 }; - lua["nonlink_obj"] = NonLink { nullptr }; + lua["link_obj"] = Link { LINK_CONSTANT }; + lua["nonlink_obj"] = NonLink { address }; sol::optional setup_result = lua.safe_script(R"( expect0_0 = { link_obj, link_obj, link_obj, link_obj } @@ -89,22 +94,31 @@ TEST_CASE("large_integer/bool", "pass bool integral value to and from lua") { REQUIRE_FALSE(setup_result.has_value()); lua.set_function("get_table_exhaustive", sol::overload(ex_f0, ex_f1, ex_f2, ex_ffail)); - - sol::optional result = lua.safe_script(R"( - result0_0 = get_table_exhaustive(expect0_0) - assert(result0_0 == 0) - result0_1 = get_table_exhaustive(expect0_1) - assert(result0_1 == FAILURE_CONSTANT) - - result1_0 = get_table_exhaustive(expect1_0) - assert(result1_0 == 1) - result1_1 = get_table_exhaustive(expect1_1) - assert(result1_1 == FAILURE_CONSTANT) - - result2_0 = get_table_exhaustive(expect2_0) - assert(result2_0 == 2) - result2_1 = get_table_exhaustive(expect2_1) - assert(result2_1 == FAILURE_CONSTANT) - )"); - REQUIRE_FALSE(result.has_value()); + { + sol::optional result = lua.safe_script(R"( + result0_0 = get_table_exhaustive(expect0_0) + assert(result0_0 == 0) + result0_1 = get_table_exhaustive(expect0_1) + assert(result0_1 == FAILURE_CONSTANT) + )"); + REQUIRE_FALSE(result.has_value()); + } + { + sol::optional result = lua.safe_script(R"( + result1_0 = get_table_exhaustive(expect1_0) + assert(result1_0 == 1) + result1_1 = get_table_exhaustive(expect1_1) + assert(result1_1 == FAILURE_CONSTANT) + )"); + REQUIRE_FALSE(result.has_value()); + } + { + sol::optional result = lua.safe_script(R"( + result2_0 = get_table_exhaustive(expect2_0) + assert(result2_0 == 2) + result2_1 = get_table_exhaustive(expect2_1) + assert(result2_1 == FAILURE_CONSTANT) + )"); + REQUIRE_FALSE(result.has_value()); + } } From 19898d8d3e6c3def33625082343428be1bb9387b Mon Sep 17 00:00:00 2001 From: spawayz <50929461+spawayz@users.noreply.github.com> Date: Tue, 13 Dec 2022 23:28:54 -0300 Subject: [PATCH 29/53] Fixed possible typo. --- documentation/source/tutorial/variables.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/source/tutorial/variables.rst b/documentation/source/tutorial/variables.rst index d2b7d3b8..8e361403 100644 --- a/documentation/source/tutorial/variables.rst +++ b/documentation/source/tutorial/variables.rst @@ -19,7 +19,7 @@ You can interact with the Lua Virtual Machine like so: :linenos: :lines: 1-10, 12-12, 20-24, 70- -From this example, you can see that there's many ways to pull out the varaibles you want. For example, to determine if a nested variable exists or not, you can use ``auto`` to capture the value of a ``table[key]`` lookup, and then use the ``.valid()`` method: +From this example, you can see that there's many ways to pull out the variables you want. For example, to determine if a nested variable exists or not, you can use ``auto`` to capture the value of a ``table[key]`` lookup, and then use the ``.valid()`` method: .. literalinclude:: ../../../examples/source/tutorials/variables_demo.cpp From eab1430ccdbf61a0d61d11bf86b4975838dcfb9a Mon Sep 17 00:00:00 2001 From: Elias Daler Date: Thu, 16 Feb 2023 12:47:17 +0100 Subject: [PATCH 30/53] Add mention of sol2::sol2 alias in build.rst --- documentation/source/build.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/source/build.rst b/documentation/source/build.rst index 712f1826..2eba6bfb 100644 --- a/documentation/source/build.rst +++ b/documentation/source/build.rst @@ -3,7 +3,7 @@ build sol2 is a header-only library. -sol2 comes with a CMake script in the top level. It is primarily made for building and running the examples and tests, but it includes exported and configured targets (``sol2``, ``sol2_single``) for your use. +sol2 comes with a CMake script in the top level. It is primarily made for building and running the examples and tests, but it includes exported and configured targets (``sol2``, ``sol2_single``) for your use. ``sol2::sol2`` alias is defined for the ``sol2`` target as well. sol2 also comes with a Meson Script. If things stop working, file a bug report. From 97806f2a7cdb18d5582f751b1b56c7b88b754977 Mon Sep 17 00:00:00 2001 From: C3pa <41503714+C3pa@users.noreply.github.com> Date: Sat, 18 Feb 2023 18:27:03 +0100 Subject: [PATCH 31/53] Fix get_max_hp mehod in property example --- examples/source/property.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/source/property.cpp b/examples/source/property.cpp index 2f173734..ae593f1b 100644 --- a/examples/source/property.cpp +++ b/examples/source/property.cpp @@ -15,7 +15,7 @@ class Player { } int get_max_hp() const { - return hp; + return maxhp; } void set_max_hp(int value) { From 64e3823bd200913d3e92123cbb2e76d9ec377d3e Mon Sep 17 00:00:00 2001 From: ShepherdSoasis Date: Mon, 17 Jul 2023 14:45:56 -0400 Subject: [PATCH 32/53] =?UTF-8?q?=F0=9F=9B=A0=20Address=20lifetime=20issue?= =?UTF-8?q?s=20through=20Lua=20references=20in=20iterators.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — 📝 Fixes #1315, #1374, and #1400. — 📝 Lifetime in iterators was referencing the wrong stack (the main thread) rather than the coroutine's stack at time of creation. — 📝 Using main_reference/main_* objects was a suitable enough fix for most of these problems. — ⚡🛠 Prevent performance and usability issues from changing containers by storing the being/end iterator separately, rather than continually invoking `deferred_uc::end(…)` every time. — 🛠 Improve sizes for stored iterators in select cases. — 🛠 Allow for sentinel-style C++20-and-beyond ranges. — 🔧 Improve single file generation CMake. — 👷‍♀️ Fix up internal Lua build system issues. --- cmake/Packages/FindKaguyaBuild.cmake | 2 +- cmake/Packages/FindLuaBridgeBuild.cmake | 2 +- cmake/Packages/FindLuaBuild.cmake | 2 +- cmake/Packages/FindLuaBuild/LuaVanilla.cmake | 43 ++-- cmake/Packages/FindLuwraBuild.cmake | 2 +- cmake/Packages/FindToLuappBuild.cmake | 2 +- examples/CMakeLists.txt | 2 +- examples/customization/CMakeLists.txt | 2 +- examples/interop/LuaBridge/CMakeLists.txt | 2 +- examples/interop/kaguya/CMakeLists.txt | 2 +- examples/interop/luwra/CMakeLists.txt | 2 +- examples/interop/tolua/CMakeLists.txt | 2 +- examples/require_dll_example/CMakeLists.txt | 4 +- include/sol/abort.hpp | 47 +++++ include/sol/base_traits.hpp | 33 ++++ include/sol/compatibility.hpp | 22 +-- include/sol/compatibility/lua_version.hpp | 14 +- include/sol/forward.hpp | 6 +- include/sol/forward_as.hpp | 44 +++++ include/sol/stack_get_unqualified.hpp | 11 +- include/sol/traits.hpp | 27 ++- include/sol/unreachable.hpp | 37 ++++ include/sol/usertype_container.hpp | 81 +++++--- include/sol/version.hpp | 35 ++-- single/CMakeLists.txt | 4 +- single/single.py | 14 +- tests/CMakeLists.txt | 7 +- tests/coroutines/CMakeLists.txt | 40 ++++ .../source/array_proxy_lifetime.cpp | 185 ++++++++++++++++++ tests/coroutines/source/main.cpp | 31 +++ .../coroutines/source/properties_lifetime.cpp | 96 +++++++++ .../simple/source/1000 - readonly warning.cpp | 2 +- ...as_function binding triggers correctly.cpp | 2 +- .../source/1067 - optional bindings.cpp | 2 +- .../1072 - capture exception propagation.cpp | 2 +- ...087 - readonly property error checking.cpp | 2 +- ...1095 - raw_get from global table fails.cpp | 2 +- .../source/1096 - functions binding wrong.cpp | 2 +- ... destructed from non-destructed memory.cpp | 2 +- ...method gets const-morphed in internals.cpp | 2 +- ...1192 - incorrect alignment calculation.cpp | 2 +- ...11 - protected_function_result nullptr.cpp | 2 +- ...add method in Lua 5.4 showing freelist.cpp | 2 +- .../source/1315 - keep-alive memory.cpp | 2 +- tests/run_time/source/container_semantics.cpp | 4 +- tests/run_time/source/containers.cpp | 4 +- 46 files changed, 701 insertions(+), 136 deletions(-) create mode 100644 include/sol/abort.hpp create mode 100644 include/sol/forward_as.hpp create mode 100644 include/sol/unreachable.hpp create mode 100644 tests/coroutines/CMakeLists.txt create mode 100644 tests/coroutines/source/array_proxy_lifetime.cpp create mode 100644 tests/coroutines/source/main.cpp create mode 100644 tests/coroutines/source/properties_lifetime.cpp diff --git a/cmake/Packages/FindKaguyaBuild.cmake b/cmake/Packages/FindKaguyaBuild.cmake index eb99c414..fe7719a3 100644 --- a/cmake/Packages/FindKaguyaBuild.cmake +++ b/cmake/Packages/FindKaguyaBuild.cmake @@ -60,7 +60,7 @@ ExternalProject_Add(KAGUYA_BUILD_SOURCE add_library(${kaguya_lib} INTERFACE) add_dependencies(${kaguya_lib} KAGUYA_BUILD_SOURCE) target_include_directories(${kaguya_lib} INTERFACE ${kaguya_include_dirs}) -target_link_libraries(${kaguya_lib} INTERFACE ${LUA_LIBRARIES}) +target_link_libraries(${kaguya_lib} INTERFACE Lua::Lua) if (NOT MSVC) target_compile_options(${kaguya_lib} INTERFACE -Wno-noexcept-type -Wno-ignored-qualifiers -Wno-unused-parameter) diff --git a/cmake/Packages/FindLuaBridgeBuild.cmake b/cmake/Packages/FindLuaBridgeBuild.cmake index b4534e23..1ee91652 100644 --- a/cmake/Packages/FindLuaBridgeBuild.cmake +++ b/cmake/Packages/FindLuaBridgeBuild.cmake @@ -59,7 +59,7 @@ ExternalProject_Add(LUABRIDGE_BUILD_SOURCE add_library(${luabridge_lib} INTERFACE) add_dependencies(${luabridge_lib} LUABRIDGE_BUILD_SOURCE) target_include_directories(${luabridge_lib} INTERFACE ${luabridge_include_dirs}) -target_link_libraries(${luabridge_lib} INTERFACE ${LUA_LIBRARIES}) +target_link_libraries(${luabridge_lib} INTERFACE Lua::Lua) if (NOT MSVC) target_compile_options(${luabridge_lib} INTERFACE -Wno-noexcept-type -Wno-ignored-qualifiers -Wno-unused-parameter) diff --git a/cmake/Packages/FindLuaBuild.cmake b/cmake/Packages/FindLuaBuild.cmake index 7e6a71f0..14fd4d48 100644 --- a/cmake/Packages/FindLuaBuild.cmake +++ b/cmake/Packages/FindLuaBuild.cmake @@ -88,7 +88,7 @@ function(find_lua_build LUA_VERSION) endif() # # Export variables to the parent scope - set(LUA_LIBRARIES ${LUA_LIBRARIES} PARENT_SCOPE) + set(LUA_LIBRARIES Lua::Lua PARENT_SCOPE) set(LUA_INTERPRETER ${LUA_INTERPRETER} PARENT_SCOPE) set(LUA_INCLUDE_DIRS ${LUA_INCLUDE_DIRS} PARENT_SCOPE) set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE) diff --git a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake index 8b1fa541..b4c3c800 100644 --- a/cmake/Packages/FindLuaBuild/LuaVanilla.cmake +++ b/cmake/Packages/FindLuaBuild/LuaVanilla.cmake @@ -103,20 +103,20 @@ if (LUA_VANILLA_VERSION MATCHES "^5\\.1") lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c) set(LUA_VANILLA_LUA_SOURCES lua.c ) -if (LUA_BUILD_LUA_COMPILER) - set(LUA_VANILLA_LUAC_SOURCES luac.c print.c ) -endif() + if (LUA_BUILD_LUA_COMPILER) + set(LUA_VANILLA_LUAC_SOURCES luac.c print.c) + endif() set(LUA_VANILLA_GENERATE_LUA_HPP true) elseif (LUA_VANILLA_VERSION MATCHES "^5\\.2") - set(LUA_VANILLA_LIB_SOURCES lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c + set(LUA_VANILLA_LIB_SOURCES lapi.c lbitlib.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c lcorolib.c ldblib.c liolib.c lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c) - set(LUA_VANILLA_LUA_SOURCES lua.c ) -if (LUA_BUILD_LUA_COMPILER) - set(LUA_VANILLA_LUAC_SOURCES luac.c ) -endif() + set(LUA_VANILLA_LUA_SOURCES lua.c) + if (LUA_BUILD_LUA_COMPILER) + set(LUA_VANILLA_LUAC_SOURCES luac.c) + endif() set(LUA_VANILLA_GENERATE_LUA_HPP false) elseif (LUA_VANILLA_VERSION MATCHES "^5\\.3") set(LUA_VANILLA_LIB_SOURCES lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c @@ -125,9 +125,9 @@ elseif (LUA_VANILLA_VERSION MATCHES "^5\\.3") lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c linit.c) set(LUA_VANILLA_LUA_SOURCES lua.c ) -if (LUA_BUILD_LUA_COMPILER) - set(LUA_VANILLA_LUAC_SOURCES luac.c ) -endif() + if (LUA_BUILD_LUA_COMPILER) + set(LUA_VANILLA_LUAC_SOURCES luac.c) + endif() set(LUA_VANILLA_GENERATE_LUA_HPP false) elseif (LUA_VANILLA_VERSION MATCHES "^5\\.4") if (LUA_VANILLA_VERSION MATCHES "work" OR LUA_VANILLA_VERSION MATCHES "alpha" OR LUA_VANILLA_VERSION MATCHES "beta") @@ -138,10 +138,10 @@ elseif (LUA_VANILLA_VERSION MATCHES "^5\\.4") llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c) - set(LUA_VANILLA_LUA_SOURCES lua.c ) -if (LUA_BUILD_LUA_COMPILER) - set(LUA_VANILLA_LUAC_SOURCES luac.c ) -endif() + set(LUA_VANILLA_LUA_SOURCES lua.c) + if (LUA_BUILD_LUA_COMPILER) + set(LUA_VANILLA_LUAC_SOURCES luac.c) + endif() set(LUA_VANILLA_GENERATE_LUA_HPP false) else() MESSAGE(WARNING "Using Lua 5.4.4 file list for ${LUA_VERSION} version") @@ -150,10 +150,10 @@ else() llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c) - set(LUA_VANILLA_LUA_SOURCES lua.c ) -if (LUA_BUILD_LUA_COMPILER) - set(LUA_VANILLA_LUAC_SOURCES luac.c ) -endif() + set(LUA_VANILLA_LUA_SOURCES lua.c) + if (LUA_BUILD_LUA_COMPILER) + set(LUA_VANILLA_LUAC_SOURCES luac.c) + endif() set(LUA_VANILLA_GENERATE_LUA_HPP false) endif() @@ -217,6 +217,7 @@ set(luacompiler "luac-${LUA_VANILLA_VERSION}") # make an actual, buildable target # that other parts of the code can depend on add_library(${liblua} ${LUA_BUILD_LIBRARY_TYPE} ${LUA_VANILLA_LIB_SOURCES}) +add_library(Lua::Lua ALIAS ${liblua}) set_target_properties(${liblua} PROPERTIES LANGUAGE ${LUA_VANILLA_LANGUAGE} @@ -233,7 +234,9 @@ set_source_files_properties(${LUA_VANILLA_LIB_SOURCES} target_include_directories(${liblua} PUBLIC "${LUA_VANILLA_INCLUDE_DIRS}") target_compile_definitions(${liblua} - PUBLIC LUA_COMPAT_ALL ${LUA_VANILLA_DLL_DEFINE}) + PUBLIC + LUA_COMPAT_ALL + ${LUA_VANILLA_DLL_DEFINE}) if (MSVC) target_compile_options(${liblua} PRIVATE /W1) diff --git a/cmake/Packages/FindLuwraBuild.cmake b/cmake/Packages/FindLuwraBuild.cmake index 0315bb84..28a5a259 100644 --- a/cmake/Packages/FindLuwraBuild.cmake +++ b/cmake/Packages/FindLuwraBuild.cmake @@ -59,7 +59,7 @@ ExternalProject_Add(LUWRA_BUILD_SOURCE add_library(${luwra_lib} INTERFACE) add_dependencies(${luwra_lib} LUWRA_BUILD_SOURCE) target_include_directories(${luwra_lib} INTERFACE ${luwra_include_dirs}) -target_link_libraries(${luwra_lib} INTERFACE ${LUA_LIBRARIES}) +target_link_libraries(${luwra_lib} INTERFACE Lua::Lua) if (NOT MSVC) target_compile_options(${luwra_lib} INTERFACE -Wno-noexcept-type -Wno-ignored-qualifiers -Wno-unused-parameter) diff --git a/cmake/Packages/FindToLuappBuild.cmake b/cmake/Packages/FindToLuappBuild.cmake index be3f11ba..652dbc01 100644 --- a/cmake/Packages/FindToLuappBuild.cmake +++ b/cmake/Packages/FindToLuappBuild.cmake @@ -65,7 +65,7 @@ set_target_properties(${toluapp_lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) target_include_directories(${toluapp_lib} PUBLIC ${toluapp_include_dirs}) -target_link_libraries(${toluapp_lib} PRIVATE ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) +target_link_libraries(${toluapp_lib} PRIVATE Lua::Lua ${CMAKE_DL_LIBS}) if (MSVC) target_compile_options(${toluapp_lib} PRIVATE /W1) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e33c45b4..0ff8a112 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,7 +24,7 @@ function(sol2_add_example_properties target-name) target_link_libraries(${target-name} - PUBLIC Threads::Threads ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) + PUBLIC Threads::Threads Lua::Lua ${CMAKE_DL_LIBS}) target_compile_definitions(${target-name} PUBLIC SOL_PRINT_ERRORS=1) target_compile_options(${target-name} diff --git a/examples/customization/CMakeLists.txt b/examples/customization/CMakeLists.txt index 48f5f5b7..11312dfe 100644 --- a/examples/customization/CMakeLists.txt +++ b/examples/customization/CMakeLists.txt @@ -50,7 +50,7 @@ function (MAKE_CUSTOMIZATION_EXAMPLE example_suffix target_sol) endif() target_link_libraries(${customization_example_name} - PRIVATE Threads::Threads ${target_sol} ${LUA_LIBRARIES}) + PRIVATE Threads::Threads ${target_sol} Lua::Lua) target_include_directories(${customization_example_name} PRIVATE include) endfunction() diff --git a/examples/interop/LuaBridge/CMakeLists.txt b/examples/interop/LuaBridge/CMakeLists.txt index 423ef625..1e2c0ae3 100644 --- a/examples/interop/LuaBridge/CMakeLists.txt +++ b/examples/interop/LuaBridge/CMakeLists.txt @@ -30,7 +30,7 @@ function (make_luabridge_interop_example target_library example_suffix) add_executable(${example_name} source/LuaBridge.cpp) target_link_libraries(${example_name} - PRIVATE ${LUA_LIBRARIES} ${LUABRIDGE_LIBRARIES} + PRIVATE Lua::Lua ${LUABRIDGE_LIBRARIES} ${target_library} ${CMAKE_DL_LIBS}) if (MSVC) diff --git a/examples/interop/kaguya/CMakeLists.txt b/examples/interop/kaguya/CMakeLists.txt index a0b7b13c..6b3a9acc 100644 --- a/examples/interop/kaguya/CMakeLists.txt +++ b/examples/interop/kaguya/CMakeLists.txt @@ -30,7 +30,7 @@ function (make_kaguya_interop_example target_library example_suffix) add_executable(${example_name} source/kaguya.cpp) target_link_libraries(${example_name} - PRIVATE ${LUA_LIBRARIES} ${KAGUYA_LIBRARIES} + PRIVATE Lua::Lua ${KAGUYA_LIBRARIES} ${target_library} ${CMAKE_DL_LIBS}) if (MSVC) diff --git a/examples/interop/luwra/CMakeLists.txt b/examples/interop/luwra/CMakeLists.txt index bf9aaced..c070ffdd 100644 --- a/examples/interop/luwra/CMakeLists.txt +++ b/examples/interop/luwra/CMakeLists.txt @@ -30,7 +30,7 @@ function (make_luwra_interop_example target_library example_suffix) add_executable(${example_name} source/luwra.cpp) target_link_libraries(${example_name} - PRIVATE ${LUA_LIBRARIES} ${LUWRA_LIBRARIES} + PRIVATE Lua::Lua ${LUWRA_LIBRARIES} ${target_library} ${CMAKE_DL_LIBS}) if (MSVC) diff --git a/examples/interop/tolua/CMakeLists.txt b/examples/interop/tolua/CMakeLists.txt index 0b4c8125..3f151ba9 100644 --- a/examples/interop/tolua/CMakeLists.txt +++ b/examples/interop/tolua/CMakeLists.txt @@ -31,7 +31,7 @@ function(make_tolua_interop_example target_library example_suffix) add_executable(${example_name} source/tolua.cpp) target_link_libraries(${example_name} PRIVATE - ${LUA_LIBRARIES} ${TOLUAPP_LIBRARIES} ${target_library} ${CMAKE_DL_LIBS}) + Lua::Lua ${TOLUAPP_LIBRARIES} ${target_library} ${CMAKE_DL_LIBS}) if (MSVC) target_compile_options(${example_name} diff --git a/examples/require_dll_example/CMakeLists.txt b/examples/require_dll_example/CMakeLists.txt index ddd40b25..15c5df1d 100644 --- a/examples/require_dll_example/CMakeLists.txt +++ b/examples/require_dll_example/CMakeLists.txt @@ -46,7 +46,7 @@ function(make_require_from_dll_example target_lib example_lib_name_suffix) PUBLIC MY_OBJECT_DLL PRIVATE MY_OBJECT_BUILD) target_link_libraries(${example_lib_name} - PUBLIC ${target_lib} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) + PUBLIC ${target_lib} Lua::Lua ${CMAKE_DL_LIBS}) target_include_directories(${example_lib_name} PUBLIC "${LUA_INCLUDE_DIRS}") @@ -83,7 +83,7 @@ function(make_require_from_dll_example target_lib example_lib_name_suffix) # add executable target that represents require_from_dll program add_executable(${example_name} ${require_from_dll_sources}) target_link_libraries(${example_name} - PRIVATE my_object ${LUA_LIBRARIES} ${target_lib} ${CMAKE_DL_LIBS}) + PRIVATE my_object Lua::Lua ${target_lib} ${CMAKE_DL_LIBS}) target_include_directories(${example_name} PRIVATE ${LUA_INCLUDE_DIRS}) diff --git a/include/sol/abort.hpp b/include/sol/abort.hpp new file mode 100644 index 00000000..692244da --- /dev/null +++ b/include/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/include/sol/base_traits.hpp b/include/sol/base_traits.hpp index 811e7992..204afc27 100644 --- a/include/sol/base_traits.hpp +++ b/include/sol/base_traits.hpp @@ -62,6 +62,39 @@ namespace sol { template