Small fix

This commit is contained in:
itqop 2024-05-15 13:29:16 +03:00
parent 9339e572a0
commit 9019f9c299
2 changed files with 140 additions and 154 deletions

View File

@ -1,9 +1,7 @@
#ifndef TOOLS_H_INCLUDE
#define TOOLS_H_INCLUDE
#define INTERNAL_BUILD 1 //when internal build is true and an assertion is hit, you have the option to debug or ignore
//when internal build if false and an asertion is hit, the error is reported and the program
//closes
#define INTERNAL_BUILD 1
#include <csignal>
@ -50,15 +48,9 @@ inline void assertFuncProduction(
switch (action)
{
case IDOK: // Abort the program:
case IDOK:
{
raise(SIGABRT);
// We won't usually get here, but it's possible that a user-registered
// abort handler returns, so exit the program immediately. Note that
// even though we are "aborting," we do not call abort() because we do
// not want to invoke Watson (the user has already had an opportunity
// to debug the error and chose not to).
_exit(3);
}
default:
@ -100,27 +92,21 @@ inline void assertFuncInternal(
switch (action)
{
case IDABORT: // Abort the program:
case IDABORT:
{
raise(SIGABRT);
// We won't usually get here, but it's possible that a user-registered
// abort handler returns, so exit the program immediately. Note that
// even though we are "aborting," we do not call abort() because we do
// not want to invoke Watson (the user has already had an opportunity
// to debug the error and chose not to).
_exit(3);
}
case IDRETRY: // Break into the debugger then return control to caller
case IDRETRY:
{
__debugbreak();
return;
}
case IDIGNORE: // Return control to caller
case IDIGNORE:
{
return;
}
default: // This should not happen; treat as fatal error:
default:
{
abort();
}
@ -157,7 +143,7 @@ inline void assertFuncInternal(
#else //linux or others
#else
inline void assertFuncProduction(
const char *expression,