diff options
author | Frances Buontempo <frances.buontempo@gmail.com> | 2012-01-04 15:46:33 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-01-04 15:46:33 (GMT) |
commit | c11461a588456193d0a78cc550f595e4f1412bf3 (patch) | |
tree | c9aea6083b78f6cba503f396d2237f5a2f996e28 /src/util.cc | |
parent | 6d338066d09b825aa18f453090333d477e2a9a06 (diff) | |
download | Ninja-c11461a588456193d0a78cc550f595e4f1412bf3.zip Ninja-c11461a588456193d0a78cc550f595e4f1412bf3.tar.gz Ninja-c11461a588456193d0a78cc550f595e4f1412bf3.tar.bz2 |
Use ExitProcess instead of exit in Fatal to allow extra cleanup for MSVC
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index e8354b8..63bd2cd 100644 --- a/src/util.cc +++ b/src/util.cc @@ -46,7 +46,15 @@ void Fatal(const char* msg, ...) { vfprintf(stderr, msg, ap); va_end(ap); fprintf(stderr, "\n"); +#ifdef WIN32 + // On Windows, some tools may inject extra threads. + // exit() may block on locks held by those threads, so forcibly exit. + fflush(stderr); + fflush(stdout); + ExitProcess(1); +#else exit(1); +#endif } void Warning(const char* msg, ...) { |