1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) would barf wide chars after llvm::errs().

llvm-svn: 199057
This commit is contained in:
NAKAMURA Takumi 2014-01-12 16:14:24 +00:00
parent ddf7787f91
commit 10c79bd94c

View File

@ -469,9 +469,10 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
: raw_ostream(unbuffered), FD(fd),
ShouldClose(shouldClose), Error(false), UseAtomicWrites(false) {
#ifdef O_BINARY
// Setting STDOUT and STDERR to binary mode is necessary in Win32
// Setting STDOUT to binary mode is necessary in Win32
// to avoid undesirable linefeed conversion.
if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
// Don't touch STDERR, or w*printf() (in assert()) would barf wide chars.
if (fd == STDOUT_FILENO)
setmode(fd, O_BINARY);
#endif