forked from Mirrorlandia_minetest/minetest
markAliasDeprecated: Fix MSVC build
This commit is contained in:
parent
766fb7b46e
commit
81c06dea9b
@ -151,11 +151,12 @@ void ModApiBase::markAliasDeprecated(luaL_Reg *reg)
|
|||||||
while (reg->func) {
|
while (reg->func) {
|
||||||
if (last_func == reg->func) {
|
if (last_func == reg->func) {
|
||||||
// Duplicate found
|
// Duplicate found
|
||||||
std::pair<std::string, luaL_Reg> entry(
|
luaL_Reg original_reg;
|
||||||
reg->name,
|
// Do not inline struct. Breaks MSVC or is error-prone
|
||||||
{ .name = last_name, .func = reg->func }
|
original_reg.name = last_name;
|
||||||
);
|
original_reg.func = reg->func;
|
||||||
m_deprecated_wrappers.emplace(entry);
|
m_deprecated_wrappers.emplace(
|
||||||
|
std::pair<std::string, luaL_Reg>(reg->name, original_reg));
|
||||||
reg->func = l_deprecated_function;
|
reg->func = l_deprecated_function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user