windows: don't buffer stdout
authorEvan Martin <martine@danga.com>
Fri, 2 Dec 2011 05:53:00 +0000 (21:53 -0800)
committerEvan Martin <martine@danga.com>
Fri, 2 Dec 2011 05:53:00 +0000 (21:53 -0800)
src/build.cc

index 1686eed..ae6ebbb 100644 (file)
@@ -70,6 +70,11 @@ BuildStatus::BuildStatus(const BuildConfig& config)
   smart_terminal_ = isatty(1) && term && string(term) != "dumb";
 #else
   smart_terminal_ = false;
+  // Disable output buffer.  It'd be nice to use line buffering but
+  // MSDN says: "For some systems, [_IOLBF] provides line
+  // buffering. However, for Win32, the behavior is the same as _IOFBF
+  // - Full Buffering."
+  setvbuf(stdout, NULL, _IONBF, 0);
 #endif
 
   // Don't do anything fancy in verbose mode.