Enable Visual Studio basic run-time checks in non-optimized builds [Oliver Stoneberg]

Flush stderr, so the data is actually written when output is being redirected [Oliver Stoneberg]
This commit is contained in:
Miodrag Milanovic 2011-05-17 13:15:29 +00:00
parent 188921974e
commit 9cf16652c7
2 changed files with 8 additions and 0 deletions

View File

@ -140,6 +140,11 @@ CCOMFLAGS += /wd4267
#LIBS += -lbufferoverflowu
endif
# enable basic run-time checks in non-optimized build
ifeq ($(OPTIMIZE),0)
CCOMFLAGS += /RTC1
endif
# enable exception handling for C++
CPPONLYFLAGS += /EHsc

View File

@ -1174,6 +1174,9 @@ static LONG WINAPI exception_filter(struct _EXCEPTION_POINTERS *info)
// walk the stack
while (walker.unwind())
fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == NULL) ? "" : symbols->symbol_for_address(walker.ip()));
// flush stderr, so the data is actually written when output is being redirected
fflush(stderr);
// exit
return EXCEPTION_CONTINUE_SEARCH;