Skip to content

Commit 7f545f7

Browse files
committed
Fix windows build
Add overload for std::string_view to PopPrimitive
1 parent bb0dedb commit 7f545f7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Shared/mods/deathmatch/logic/lua/LuaBasic.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ namespace lua
6060
return outValue;
6161
}
6262

63+
64+
template <>
65+
std::string_view PopPrimitive<std::string_view>(lua_State* L, std::size_t& index)
66+
{
67+
uint uiLength = lua_strlen(L, index);
68+
std::string_view outValue(lua_tostring(L, index++), uiLength);
69+
return outValue;
70+
}
71+
6372
template <>
6473
int PopPrimitive<int>(lua_State* L, std::size_t& index)
6574
{
@@ -73,9 +82,9 @@ namespace lua
7382
}
7483

7584
template <>
76-
std::size_t PopPrimitive<std::size_t>(lua_State* L, std::size_t& index)
85+
uint64_t PopPrimitive<uint64_t>(lua_State* L, std::size_t& index)
7786
{
78-
return static_cast<std::size_t>(lua_tonumber(L, index++));
87+
return static_cast<uint64_t>(lua_tonumber(L, index++));
7988
}
8089

8190
template <>

0 commit comments

Comments
 (0)