Win32: emit dbp() output to stderr as well in Debug builds.
This commit is contained in:
parent
c83421a2b5
commit
14cf0e09df
@ -25,12 +25,18 @@ void dbp(const char *str, ...)
|
|||||||
// The native version of OutputDebugString, unlike most others,
|
// The native version of OutputDebugString, unlike most others,
|
||||||
// is OutputDebugStringA.
|
// is OutputDebugStringA.
|
||||||
OutputDebugStringA(buf);
|
OutputDebugStringA(buf);
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
// Duplicate to stderr in debug builds, but not in release; this is slow.
|
||||||
|
fputs(buf, stderr);
|
||||||
|
fputc('\n', stderr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void assert_failure(const char *file, unsigned line, const char *function,
|
void assert_failure(const char *file, unsigned line, const char *function,
|
||||||
const char *condition, const char *message) {
|
const char *condition, const char *message) {
|
||||||
dbp("File %s, line %u, function %s:\n", file, line, function);
|
dbp("File %s, line %u, function %s:", file, line, function);
|
||||||
dbp("Assertion '%s' failed: ((%s) == false).\n", message, condition);
|
dbp("Assertion '%s' failed: ((%s) == false).", message, condition);
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
_exit(1);
|
_exit(1);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user