mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix segfault in deprecation logging due to tail call, log by default (#10174)
This commit is contained in:
parent
2dff3dd03f
commit
89dd05fdf3
9 changed files with 71 additions and 80 deletions
|
@ -114,5 +114,25 @@ void script_error(lua_State *L, int pcall_result, const char *mod, const char *f
|
|||
void script_run_callbacks_f(lua_State *L, int nargs,
|
||||
RunCallbacksMode mode, const char *fxn);
|
||||
|
||||
enum class DeprecatedHandlingMode {
|
||||
Ignore,
|
||||
Log,
|
||||
Error
|
||||
};
|
||||
|
||||
/**
|
||||
* Reads `deprecated_lua_api_handling` in settings, returns cached value.
|
||||
*
|
||||
* @return DeprecatedHandlingMode
|
||||
*/
|
||||
DeprecatedHandlingMode get_deprecated_handling_mode();
|
||||
|
||||
/**
|
||||
* Handles a deprecation warning based on user settings
|
||||
*
|
||||
* @param L Lua State
|
||||
* @param message The deprecation method
|
||||
* @param stack_depth How far on the stack to the first user function (ie: not builtin or core)
|
||||
*/
|
||||
void log_deprecated(lua_State *L, const std::string &message,
|
||||
int stack_depth=1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue