aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_base.cpp
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2018-09-11 19:32:10 +0200
committerSmallJoker <mk939@ymail.com>2018-09-11 19:32:10 +0200
commit81c06dea9b6b863e0c8f6a9c052a5cea3a130eab (patch)
tree8338dbd7f304b9b95f7bcce5d7e7ff1d0c11b991 /src/script/lua_api/l_base.cpp
parent766fb7b46edab47f96b8b940e390daf5319261b7 (diff)
downloadminetest-81c06dea9b6b863e0c8f6a9c052a5cea3a130eab.tar.gz
minetest-81c06dea9b6b863e0c8f6a9c052a5cea3a130eab.tar.bz2
minetest-81c06dea9b6b863e0c8f6a9c052a5cea3a130eab.zip
markAliasDeprecated: Fix MSVC build
Diffstat (limited to 'src/script/lua_api/l_base.cpp')
-rw-r--r--src/script/lua_api/l_base.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/script/lua_api/l_base.cpp b/src/script/lua_api/l_base.cpp
index 784b197e1..8486fc7bc 100644
--- a/src/script/lua_api/l_base.cpp
+++ b/src/script/lua_api/l_base.cpp
@@ -151,11 +151,12 @@ void ModApiBase::markAliasDeprecated(luaL_Reg *reg)
while (reg->func) {
if (last_func == reg->func) {
// Duplicate found
- std::pair<std::string, luaL_Reg> entry(
- reg->name,
- { .name = last_name, .func = reg->func }
- );
- m_deprecated_wrappers.emplace(entry);
+ luaL_Reg original_reg;
+ // Do not inline struct. Breaks MSVC or is error-prone
+ original_reg.name = last_name;
+ original_reg.func = reg->func;
+ m_deprecated_wrappers.emplace(
+ std::pair<std::string, luaL_Reg>(reg->name, original_reg));
reg->func = l_deprecated_function;
}