Skip to content

Commit

Permalink
markAliasDeprecated: Fix MSVC build
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Sep 11, 2018
1 parent 766fb7b commit 81c06de
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/script/lua_api/l_base.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 81c06de

Please sign in to comment.