From 55b8ca317ab1f77850f498c1523355e1f5dd8d03 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 15 Nov 2020 03:53:47 +1100 Subject: -Switch to building MAME as C++17. * Updated sol2 to 3.2.2 * Updated pugixml to 1.10 * Increased minimum clang version to 6 * Cleaned up some stuff that can use new features --- 3rdparty/sol2/examples/protected_functions.cpp | 47 -------------------------- 1 file changed, 47 deletions(-) delete mode 100644 3rdparty/sol2/examples/protected_functions.cpp (limited to '3rdparty/sol2/examples/protected_functions.cpp') diff --git a/3rdparty/sol2/examples/protected_functions.cpp b/3rdparty/sol2/examples/protected_functions.cpp deleted file mode 100644 index 340f0134d63..00000000000 --- a/3rdparty/sol2/examples/protected_functions.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include - -#include - -int main() { - std::cout << "=== protected_functions example ===" << std::endl; - - sol::state lua; - - // A complicated function which can error out - // We define both in terms of Lua code - - lua.script(R"( - function handler (message) - return "Handled this message: " .. message - end - - function f (a) - if a < 0 then - error("negative number detected") - end - return a + 5 - end - )"); - - // Get a protected function out of Lua - sol::protected_function f = lua["f"]; - // Set a non-default error handler - f.error_handler = lua["handler"]; - - sol::protected_function_result result = f(-500); - if (result.valid()) { - // Call succeeded - int x = result; - std::cout << "call succeeded, result is " << x << std::endl; - } - else { - // Call failed - sol::error err = result; - std::string what = err.what(); - std::cout << "call failed, sol::error::what() is " << what << std::endl; - // 'what' Should read - // "Handled this message: negative number detected" - } - - std::cout << std::endl; -} -- cgit v1.2.3-70-g09d2