Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 39f0fff

Browse files
committed
Disable crash/debug dialog when aborting in release builds
1 parent abd600a commit 39f0fff

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

System/RTEError.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
#define DebuggerBreak ;
1111
#endif
1212

13+
#if defined DEBUG_BUILD || defined MIN_DEBUG_BUILD
14+
#define AbortAction DebuggerBreak
15+
#else
16+
#define AbortAction std::exit(EXIT_FAILURE);
17+
#endif
18+
1319
namespace RTE {
1420

1521
/// <summary>
@@ -27,8 +33,8 @@ namespace RTE {
2733
extern bool RTEAbortFunc(const char *description, const char *file, int line);
2834
extern bool RTEAbortFunc(const std::string description, const char *file, int line);
2935

30-
#define RTEAbort(description) { \
31-
if (RTEAbortFunc(description, __FILE__, __LINE__)) { DebuggerBreak } \
36+
#define RTEAbort(description) { \
37+
if (RTEAbortFunc(description, __FILE__, __LINE__)) { AbortAction } \
3238
}
3339

3440
/// <summary>
@@ -47,7 +53,7 @@ namespace RTE {
4753
#define RTEAssert(expression, description) { \
4854
static bool alwaysIgnore = false; \
4955
if (!alwaysIgnore) { \
50-
if (RTEAssertFunc(expression, description, __FILE__, __LINE__, alwaysIgnore)) { DebuggerBreak } \
56+
if (RTEAssertFunc(expression, description, __FILE__, __LINE__, alwaysIgnore)) { AbortAction } \
5157
} \
5258
}
5359
}

0 commit comments

Comments
 (0)