Skip to content

Commit

Permalink
[singlejar] Replace setbuffer with setvbuf
Browse files Browse the repository at this point in the history
`setbuffer` is not available on MSVC, use C-standard `setvbuf` from `stdio.h` instead.

`setbuffer` was introduced in b4cf5e3.

#2241 /cc @laszlocsomor

Closes #5500.

PiperOrigin-RevId: 203083781
  • Loading branch information
rongjiecomputer authored and Copybara-Service committed Jul 3, 2018
1 parent 20637b7 commit f37b2bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/singlejar/output_jar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ bool OutputJar::Open() {
}
outpos_ = 0;
buffer_.reset(new char[kBufferSize]);
setbuffer(file_, buffer_.get(), kBufferSize);
setvbuf(file_, buffer_.get(), _IOFBF, kBufferSize);
if (options_->verbose) {
fprintf(stderr, "Writing to %s\n", path());
}
Expand Down

0 comments on commit f37b2bf

Please sign in to comment.