Skip to content

Commit

Permalink
Set cout to unbuffered on mingw/cygwin (fixes AGWA#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasa committed Feb 23, 2018
1 parent 804f7c9 commit 701fb8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions util-win32.cpp
Expand Up @@ -170,6 +170,7 @@ static void init_std_streams_platform ()
{
_setmode(_fileno(stdin), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
std::cout.setf(std::ios::unitbuf);
}

void create_protected_file (const char* path) // TODO
Expand Down
2 changes: 1 addition & 1 deletion util.cpp
Expand Up @@ -150,7 +150,7 @@ void init_std_streams ()
init_std_streams_platform();
}

#ifdef _WIN32
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "util-win32.cpp"
#else
#include "util-unix.cpp"
Expand Down

0 comments on commit 701fb8e

Please sign in to comment.