diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-28 17:38:36 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-28 17:38:36 +0100 |
commit | 53236cf0472b5093195bcc128dec6b45a6fe1446 (patch) | |
tree | 6f419cbcfbece10b4ba920b9713bcc3e8aa0b34f /src/luaerrors.h | |
parent | b5b4929e747a0904077e79fe656664f24997aca1 (diff) | |
download | lanes-53236cf0472b5093195bcc128dec6b45a6fe1446.tar.gz lanes-53236cf0472b5093195bcc128dec6b45a6fe1446.tar.bz2 lanes-53236cf0472b5093195bcc128dec6b45a6fe1446.zip |
Renamed luaerrors.h → luaerrors.hpp
Diffstat (limited to 'src/luaerrors.h')
-rw-r--r-- | src/luaerrors.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/luaerrors.h b/src/luaerrors.h deleted file mode 100644 index ef32c60..0000000 --- a/src/luaerrors.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "stackindex.hpp" | ||
4 | |||
5 | // ################################################################################################# | ||
6 | |||
7 | // use this instead of Lua's lua_error | ||
8 | [[noreturn]] static inline void raise_lua_error(lua_State* const L_) | ||
9 | { | ||
10 | std::ignore = lua_error(L_); // doesn't return | ||
11 | assert(false); // we should never get here, but i'm paranoid | ||
12 | } | ||
13 | |||
14 | // ################################################################################################# | ||
15 | |||
16 | // use this instead of Lua's luaL_error | ||
17 | template <typename... ARGS> | ||
18 | [[noreturn]] static inline void raise_luaL_error(lua_State* const L_, std::string_view const& fmt_, ARGS... args_) | ||
19 | { | ||
20 | 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 | ||
22 | } | ||
23 | |||
24 | // ################################################################################################# | ||
25 | |||
26 | // use this instead of Lua's luaL_argerror | ||
27 | template <typename... ARGS> | ||
28 | [[noreturn]] static inline void raise_luaL_argerror(lua_State* const L_, StackIndex const arg_, std::string_view const& extramsg_) | ||
29 | { | ||
30 | std::ignore = luaL_argerror(L_, arg_, extramsg_.data()); // doesn't return | ||
31 | assert(false); // we should never get here, but i'm paranoid | ||
32 | } | ||
33 | |||
34 | // ################################################################################################# | ||
35 | |||
36 | #if LUA_VERSION_NUM >= 504 | ||
37 | // use this instead of Lua's luaL_typeerror | ||
38 | template <typename... ARGS> | ||
39 | [[noreturn]] static inline void raise_luaL_typeerror(lua_State* const L_, StackIndex const arg_, std::string_view const& tname_) | ||
40 | { | ||
41 | std::ignore = luaL_typeerror(L_, arg_, tname_.data()); // doesn't return | ||
42 | assert(false); // we should never get here, but i'm paranoid | ||
43 | } | ||
44 | #endif // LUA_VERSION_NUM | ||