diff options
Diffstat (limited to 'src/common/Debugging/Errors.cpp')
-rw-r--r-- | src/common/Debugging/Errors.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index 45f130ceb3b..4c7e91a8219 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -59,10 +59,15 @@ void Assert(char const* file, int line, char const* function, char const* messag exit(1); } -void Fatal(char const* file, int line, char const* function, char const* message) +void Fatal(char const* file, int line, char const* function, char const* message, ...) { - fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n", - file, line, function, message); + va_list args; + va_start(args, message); + + fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n ", file, line, function); + vfprintf(stderr, message, args); + fprintf(stderr, "\n"); + fflush(stderr); std::this_thread::sleep_for(std::chrono::seconds(10)); *((volatile int*)NULL) = 0; |