aboutsummaryrefslogtreecommitdiff
path: root/src/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat.h')
-rw-r--r--src/compat.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compat.h b/src/compat.h
index e080749..139e606 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -133,14 +133,14 @@ inline int lua504_dump(lua_State* L_, lua_Writer writer_, void* data_, [[maybe_u
133 133
134// ################################################################################################# 134// #################################################################################################
135 135
136[[nodiscard]] inline LuaType luaG_getfield(lua_State* L_, int idx_, char const* k_) 136[[nodiscard]] inline LuaType luaG_getfield(lua_State* L_, int idx_, std::string_view const& k_)
137{ 137{
138// starting with Lua 5.3, lua_getfield returns the type of the value it found 138// starting with Lua 5.3, lua_getfield returns the type of the value it found
139#if LUA_VERSION_NUM < 503 139#if LUA_VERSION_NUM < 503
140 lua_getfield(L_, idx_, k_); 140 lua_getfield(L_, idx_, k_.data());
141 return lua_type_as_enum(L_, -1); 141 return lua_type_as_enum(L_, -1);
142#else // LUA_VERSION_NUM >= 503 142#else // LUA_VERSION_NUM >= 503
143 return static_cast<LuaType>(lua_getfield(L_, idx_, k_)); 143 return static_cast<LuaType>(lua_getfield(L_, idx_, k_.data()));
144#endif // LUA_VERSION_NUM >= 503 144#endif // LUA_VERSION_NUM >= 503
145} 145}
146 146
@@ -243,7 +243,7 @@ inline constexpr LuaError ToLuaError(int rc_)
243 243
244// ################################################################################################# 244// #################################################################################################
245 245
246LuaType luaG_getmodule(lua_State* L_, char const* name_); 246LuaType luaG_getmodule(lua_State* L_, std::string_view const& name_);
247 247
248// ################################################################################################# 248// #################################################################################################
249 249