Skip to content

Commit

Permalink
Merge pull request #563 from oktal/example-compilation-fix
Browse files Browse the repository at this point in the history
#562: example: parsebyparts now compiles with g++-4.9
  • Loading branch information
miloyip committed Feb 28, 2016
2 parents 2d5d936 + d53d71b commit ef5e74a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include_directories("../include/")
add_definitions(-D__STDC_FORMAT_MACROS)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Werror -Wall -Wextra -Weffc++ -Wswitch-default")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
Expand Down
10 changes: 9 additions & 1 deletion example/parsebyparts/parsebyparts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ using namespace rapidjson;
template<unsigned parseFlags = kParseDefaultFlags>
class AsyncDocumentParser {
public:
AsyncDocumentParser(Document& d) : stream_(*this), d_(d), parseThread_(&AsyncDocumentParser::Parse, this), completed_() {}
AsyncDocumentParser(Document& d)
: stream_(*this)
, d_(d)
, parseThread_(&AsyncDocumentParser::Parse, this)
, mutex_()
, notEmpty_()
, finish_()
, completed_()
{}

~AsyncDocumentParser() {
if (!parseThread_.joinable())
Expand Down

0 comments on commit ef5e74a

Please sign in to comment.