From 2b2a6d2ab1dc823d674f641154ed224173509f6c Mon Sep 17 00:00:00 2001 From: ThePhD Date: Thu, 24 Aug 2017 17:12:13 -0400 Subject: [PATCH] One day, Lua 5.1 will be phased out of existence and everyone will have the latest and greatest... ... One day. --- examples/pairs.cpp | 3 ++- examples/pairs_with_raw_functions.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/pairs.cpp b/examples/pairs.cpp index 3625c19a..b2470bcf 100644 --- a/examples/pairs.cpp +++ b/examples/pairs.cpp @@ -77,13 +77,14 @@ int main(int, char*[]) { sol::meta_function::pairs, my_pairs ); +#ifdef SOL_LUA_VERSION < 502 lua.safe_script(R"( local mt = my_thing.new() for k, v in pairs(mt) do print(k, v) end )"); - +#endif // Does not work on Lua 5.1 std::cout << std::endl; return 0; diff --git a/examples/pairs_with_raw_functions.cpp b/examples/pairs_with_raw_functions.cpp index 8143d2fa..8134c2ab 100644 --- a/examples/pairs_with_raw_functions.cpp +++ b/examples/pairs_with_raw_functions.cpp @@ -72,12 +72,14 @@ int main(int, char*[]) { sol::meta_function::pairs, &my_pairs ); +#ifdef SOL_LUA_VERSION < 502 lua.safe_script(R"( local mt = my_thing.new() for k, v in pairs(mt) do print(k, v) end )"); +#endif // Does not work on Lua 5.1 and below std::cout << std::endl;