1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives

This commit is contained in:
Craig Robbins 2015-03-06 20:21:51 +10:00
parent a603a76787
commit ced6d20295
62 changed files with 299 additions and 294 deletions

View file

@ -87,7 +87,7 @@ void script_error(lua_State *L)
// computed depending on mode
void script_run_callbacks(lua_State *L, int nargs, RunCallbacksMode mode)
{
assert(lua_gettop(L) >= nargs + 1);
FATAL_ERROR_IF(lua_gettop(L) < nargs + 1, "Not enough arguments");
// Insert error handler
lua_pushcfunction(L, script_error_handler);
@ -136,9 +136,7 @@ void log_deprecated(lua_State *L, std::string message)
if (L != NULL) {
script_error(L);
} else {
/* As of april 2014 assert is not optimized to nop in release builds
* therefore this is correct. */
assert("Can't do a scripterror for this deprecated message, so exit completely!");
FATAL_ERROR("Can't do a scripterror for this deprecated message, so exit completely!");
}
}