summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/sol2/test_stack_guard.hpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-07 14:43:09 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-07 14:43:09 +0200
commit377472a6dd2c9bdff4d5667f5789c49aee2abb4c (patch)
treea0ce4d6fc3db1524609efc61307d48448e703f38 /3rdparty/sol2/test_stack_guard.hpp
parent1335933ce00cf6095e403a24d0b1dd9e0b565650 (diff)
Added sol2 header only library as future replacement for luabridge (nw)
Diffstat (limited to '3rdparty/sol2/test_stack_guard.hpp')
-rw-r--r--3rdparty/sol2/test_stack_guard.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/3rdparty/sol2/test_stack_guard.hpp b/3rdparty/sol2/test_stack_guard.hpp
new file mode 100644
index 00000000000..d77ffb8b682
--- /dev/null
+++ b/3rdparty/sol2/test_stack_guard.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+struct test_stack_guard {
+ lua_State* L;
+ int& begintop;
+ int& endtop;
+ test_stack_guard(lua_State* L, int& begintop, int& endtop) : L(L), begintop(begintop), endtop(endtop) {
+ begintop = lua_gettop(L);
+ }
+ ~test_stack_guard() { endtop = lua_gettop(L); }
+};