Merge pull request #1105 from clach04/issue_1104_solaris_fread

Fix issue #1104 Solaris compilation errors fread()/fwrite()
This commit is contained in:
Milo Yip 2017-10-27 17:12:55 +08:00 committed by GitHub
commit 5aa79b7272
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ private:
++current_;
else if (!eof_) {
count_ += readCount_;
readCount_ = fread(buffer_, 1, bufferSize_, fp_);
readCount_ = std::fread(buffer_, 1, bufferSize_, fp_);
bufferLast_ = buffer_ + readCount_ - 1;
current_ = buffer_;

View File

@ -62,7 +62,7 @@ public:
void Flush() {
if (current_ != buffer_) {
size_t result = fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);
size_t result = std::fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);
if (result < static_cast<size_t>(current_ - buffer_)) {
// failure deliberately ignored at this time
// added to avoid warn_unused_result build errors