From bc96c1d7b263920e2f2147227985d2f8faf9bcf4 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 16 Feb 2020 16:52:39 +0100 Subject: [PATCH] Fix some more derps in the code. Also, `std::iterator` is a zombie! --- include/sol/stack_push.hpp | 4 ++++ include/sol/table_iterator.hpp | 10 ++++------ single/include/sol/forward.hpp | 4 ++-- single/include/sol/sol.hpp | 16 +++++++++------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index 47a51e3d..dcddffca 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -300,14 +300,18 @@ namespace sol { namespace stack { luaL_Stream* source { std::forward(args)... }; luaL_Stream* stream = static_cast(lua_newuserdata(L, sizeof(luaL_Stream))); stream->f = source->f; +#if !defined(SOL_LUAJIT) && (SOL_LUA_VERSION > 501) stream->closef = source->closef; +#endif // LuaJIT and Lua 5.1 and below do not have return 1; } else if constexpr (std::is_same_v) { luaL_Stream& source(std::forward(args)...); luaL_Stream* stream = static_cast(lua_newuserdata(L, sizeof(luaL_Stream))); stream->f = source.f; +#if !defined(SOL_LUAJIT) && (SOL_LUA_VERSION > 501) stream->closef = source.closef; +#endif // LuaJIT and Lua 5.1 and below do not have return 1; } else if constexpr (std::is_enum_v) { diff --git a/include/sol/table_iterator.hpp b/include/sol/table_iterator.hpp index 3f5662c5..93579e0c 100644 --- a/include/sol/table_iterator.hpp +++ b/include/sol/table_iterator.hpp @@ -1,4 +1,4 @@ -// sol3 +// sol3 // The MIT License (MIT) @@ -30,7 +30,7 @@ namespace sol { template - class basic_table_iterator : public std::iterator> { + class basic_table_iterator { public: typedef object key_type; typedef object mapped_type; @@ -49,12 +49,10 @@ namespace sol { std::ptrdiff_t idx = 0; public: - basic_table_iterator() - : keyidx(-1), idx(-1) { + basic_table_iterator() : keyidx(-1), idx(-1) { } - basic_table_iterator(reference_type x) - : ref(std::move(x)) { + basic_table_iterator(reference_type x) : ref(std::move(x)) { ref.push(); tableidx = lua_gettop(ref.lua_state()); stack::push(ref.lua_state(), lua_nil); diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index 35bb58e8..cf6210d5 100644 --- a/single/include/sol/forward.hpp +++ b/single/include/sol/forward.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2020-01-28 18:44:18.449629 UTC -// This header was generated with sol v3.2.0 (revision 903f4db) +// Generated 2020-02-16 15:49:14.865259 UTC +// This header was generated with sol v3.2.0 (revision 47fbab3) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index dedeb2d1..0a15bda1 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2020-01-28 18:44:17.872076 UTC -// This header was generated with sol v3.2.0 (revision 903f4db) +// Generated 2020-02-16 15:49:14.208571 UTC +// This header was generated with sol v3.2.0 (revision 47fbab3) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -13429,14 +13429,18 @@ namespace sol { namespace stack { luaL_Stream* source { std::forward(args)... }; luaL_Stream* stream = static_cast(lua_newuserdata(L, sizeof(luaL_Stream))); stream->f = source->f; +#if !defined(SOL_LUAJIT) && (SOL_LUA_VERSION > 501) stream->closef = source->closef; +#endif // LuaJIT and Lua 5.1 and below do not have return 1; } else if constexpr (std::is_same_v) { luaL_Stream& source(std::forward(args)...); luaL_Stream* stream = static_cast(lua_newuserdata(L, sizeof(luaL_Stream))); stream->f = source.f; +#if !defined(SOL_LUAJIT) && (SOL_LUA_VERSION > 501) stream->closef = source.closef; +#endif // LuaJIT and Lua 5.1 and below do not have return 1; } else if constexpr (std::is_enum_v) { @@ -22890,7 +22894,7 @@ namespace sol { namespace sol { template - class basic_table_iterator : public std::iterator> { + class basic_table_iterator { public: typedef object key_type; typedef object mapped_type; @@ -22909,12 +22913,10 @@ namespace sol { std::ptrdiff_t idx = 0; public: - basic_table_iterator() - : keyidx(-1), idx(-1) { + basic_table_iterator() : keyidx(-1), idx(-1) { } - basic_table_iterator(reference_type x) - : ref(std::move(x)) { + basic_table_iterator(reference_type x) : ref(std::move(x)) { ref.push(); tableidx = lua_gettop(ref.lua_state()); stack::push(ref.lua_state(), lua_nil);