Skip to content

Commit 701fb8e

Browse files
committed
Set cout to unbuffered on mingw/cygwin (fixes #144)
1 parent 804f7c9 commit 701fb8e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

util-win32.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ static void init_std_streams_platform ()
170170
{
171171
_setmode(_fileno(stdin), _O_BINARY);
172172
_setmode(_fileno(stdout), _O_BINARY);
173+
std::cout.setf(std::ios::unitbuf);
173174
}
174175

175176
void create_protected_file (const char* path) // TODO

util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void init_std_streams ()
150150
init_std_streams_platform();
151151
}
152152

153-
#ifdef _WIN32
153+
#if defined(_WIN32) && !defined(__CYGWIN__)
154154
#include "util-win32.cpp"
155155
#else
156156
#include "util-unix.cpp"

0 commit comments

Comments
 (0)