aboutsummaryrefslogtreecommitdiff
path: root/src/luaerrors.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/luaerrors.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/luaerrors.hpp b/src/luaerrors.hpp
index ef32c60..57c2e2e 100644
--- a/src/luaerrors.hpp
+++ b/src/luaerrors.hpp
@@ -5,7 +5,8 @@
5// ################################################################################################# 5// #################################################################################################
6 6
7// use this instead of Lua's lua_error 7// use this instead of Lua's lua_error
8[[noreturn]] static inline void raise_lua_error(lua_State* const L_) 8[[noreturn]]
9static inline void raise_lua_error(lua_State* const L_)
9{ 10{
10 std::ignore = lua_error(L_); // doesn't return 11 std::ignore = lua_error(L_); // doesn't return
11 assert(false); // we should never get here, but i'm paranoid 12 assert(false); // we should never get here, but i'm paranoid
@@ -15,7 +16,8 @@
15 16
16// use this instead of Lua's luaL_error 17// use this instead of Lua's luaL_error
17template <typename... ARGS> 18template <typename... ARGS>
18[[noreturn]] static inline void raise_luaL_error(lua_State* const L_, std::string_view const& fmt_, ARGS... args_) 19[[noreturn]]
20static inline void raise_luaL_error(lua_State* const L_, std::string_view const& fmt_, ARGS... args_)
19{ 21{
20 std::ignore = luaL_error(L_, fmt_.data(), std::forward<ARGS>(args_)...); // doesn't return 22 std::ignore = luaL_error(L_, fmt_.data(), std::forward<ARGS>(args_)...); // doesn't return
21 assert(false); // we should never get here, but i'm paranoid 23 assert(false); // we should never get here, but i'm paranoid
@@ -25,7 +27,8 @@ template <typename... ARGS>
25 27
26// use this instead of Lua's luaL_argerror 28// use this instead of Lua's luaL_argerror
27template <typename... ARGS> 29template <typename... ARGS>
28[[noreturn]] static inline void raise_luaL_argerror(lua_State* const L_, StackIndex const arg_, std::string_view const& extramsg_) 30[[noreturn]]
31static inline void raise_luaL_argerror(lua_State* const L_, StackIndex const arg_, std::string_view const& extramsg_)
29{ 32{
30 std::ignore = luaL_argerror(L_, arg_, extramsg_.data()); // doesn't return 33 std::ignore = luaL_argerror(L_, arg_, extramsg_.data()); // doesn't return
31 assert(false); // we should never get here, but i'm paranoid 34 assert(false); // we should never get here, but i'm paranoid
@@ -36,7 +39,8 @@ template <typename... ARGS>
36#if LUA_VERSION_NUM >= 504 39#if LUA_VERSION_NUM >= 504
37// use this instead of Lua's luaL_typeerror 40// use this instead of Lua's luaL_typeerror
38template <typename... ARGS> 41template <typename... ARGS>
39[[noreturn]] static inline void raise_luaL_typeerror(lua_State* const L_, StackIndex const arg_, std::string_view const& tname_) 42[[noreturn]]
43static inline void raise_luaL_typeerror(lua_State* const L_, StackIndex const arg_, std::string_view const& tname_)
40{ 44{
41 std::ignore = luaL_typeerror(L_, arg_, tname_.data()); // doesn't return 45 std::ignore = luaL_typeerror(L_, arg_, tname_.data()); // doesn't return
42 assert(false); // we should never get here, but i'm paranoid 46 assert(false); // we should never get here, but i'm paranoid