aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_base.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2018-07-01 12:31:49 +0200
committerGitHub <noreply@github.com>2018-07-01 12:31:49 +0200
commit49509d2f746b7a8d50e685cfd0e0b391676b9466 (patch)
treee73ea6eaab8682550acf38ae29c22ea00a74f6e6 /src/script/lua_api/l_base.h
parent6f22d14206824911b620ecec450689f84e6d278b (diff)
downloadminetest-49509d2f746b7a8d50e685cfd0e0b391676b9466.tar.gz
minetest-49509d2f746b7a8d50e685cfd0e0b391676b9466.tar.bz2
minetest-49509d2f746b7a8d50e685cfd0e0b391676b9466.zip
Log deprecated Lua function calls (#7491)
Diffstat (limited to 'src/script/lua_api/l_base.h')
-rw-r--r--src/script/lua_api/l_base.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h
index 12c1a86cc..b46b5b567 100644
--- a/src/script/lua_api/l_base.h
+++ b/src/script/lua_api/l_base.h
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/c_internal.h"
#include "common/helper.h"
#include "gamedef.h"
+#include <unordered_map>
extern "C" {
#include <lua.h>
@@ -70,4 +71,11 @@ public:
const char* name,
lua_CFunction func,
int top);
+
+ static int l_deprecated_function(lua_State *L);
+ static void markAliasDeprecated(luaL_Reg *reg);
+private:
+ // <old_name> = { <new_name>, <new_function> }
+ static std::unordered_map<std::string, luaL_Reg> m_deprecated_wrappers;
+ static bool m_error_deprecated_calls;
};