Skip to content

Commit

Permalink
Revert of Unconditionally include <string> and <iostream> in json_rea…
Browse files Browse the repository at this point in the history
…der.cpp (https://codereview.chromium.org/291803003/)

Reason for revert:
This adds a static initializer.

Original issue's description:
> Unconditionally include <string> and <iostream> in json_reader.cpp
> Non-PNaCl builds that use libc++ also require these headers.
> 
> BUG=None
> R=mallinath@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271429

TBR=mallinath@chromium.org,ronghuawu@chromium.org,glider@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=None

Review URL: https://codereview.chromium.org/290923003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271446 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thakis@chromium.org committed May 19, 2014
1 parent 9d80c82 commit 5f8ec0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions third_party/jsoncpp/overrides/src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
#include <cassert>
#include <cstring>
#include <stdexcept>
#ifdef __pnacl__
// This file uses the following headers (at least in Reader::parse), but
// the upstream version doesn't include them because iostream pulls in
// static initializers. This breaks builds that use libc++ (including PNaCl),
// because libc++ declares getline in <string> (as per the C++ standard)
// static initializers. This breaks the PNaCl build because it uses
// libc++ which declares getline in <string> (as per the C++ standard)
// but defines it in <iostream>. The code therefore fails linking, which
// these includes fix.
#include <string>
#include <iostream>
#endif

#if _MSC_VER >= 1400 // VC++ 8.0
#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
Expand Down

0 comments on commit 5f8ec0f

Please sign in to comment.