Skip to content

Commit

Permalink
Fixes an issue with libc++ eof handling in rapidjson
Browse files Browse the repository at this point in the history
The credit to this fix is due to @zittix. This closes issue strands-project#51.

This is due to a bug in the mac version of libc++ and should be fixed in
HEAD. See here for a related stackoverflow post:
http://stackoverflow.com/questions/14147667/clang-and-libc-istreampeek-does-not-set-eof-flag
  • Loading branch information
randvoorhies committed Feb 14, 2014
1 parent cde2d29 commit 24ce678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/cereal/external/rapidjson/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class GenericReader {
}
SkipWhitespace(stream);

if (stream.Peek() != '\0')
if (stream.Peek() != '\0' && stream.Peek() != static_cast<Ch>(std::char_traits<Ch>::eof()))
RAPIDJSON_PARSE_ERROR("Nothing should follow the root object or array.", stream.Tell());
}

Expand Down

0 comments on commit 24ce678

Please sign in to comment.