diff --git a/lib/JSON/json_reader.cpp b/lib/JSON/json_reader.cpp
index 4eb2d11..680c2b6 100644
--- a/lib/JSON/json_reader.cpp
+++ b/lib/JSON/json_reader.cpp
@@ -877,7 +877,12 @@ std::istream& operator>>( std::istream &sin, Value &root )
Json::Reader reader;
bool ok = reader.parse(sin, root, true);
//JSON_ASSERT( ok );
+#if JSON_USE_EXCEPTION
if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages());
+#else
+ assert(ok && "Bad Format!");
+ (void) ok;
+#endif
return sin;
}
diff --git a/lib/JSON/json_value.cpp b/lib/JSON/json_value.cpp
index 573205f..34acce9 100644
--- a/lib/JSON/json_value.cpp
+++ b/lib/JSON/json_value.cpp
@@ -15,7 +15,12 @@
#define JSON_ASSERT_UNREACHABLE assert( false )
#define JSON_ASSERT( condition ) assert( condition ); // @todo <=
change this into an exception throw
-#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition ))
throw std::runtime_error( message );
+// Do not use throw when exception is disable.
+#if JSON_USE_EXCEPTION
+# define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition
)) throw std::runtime_error( message );
+#else
+# define JSON_ASSERT_MESSAGE( condition, message ) JSON_ASSERT(
condition ) // @todo <= provide the message
+#endif
namespace Json {
--
1.7.4
Tobi
you are welcome, we can also try to commit this to the "main stream"
of this JSON library? but i do not know where did you find the library
:)
best regards
ether
It is jsoncpp[1] version 0.5. We should probably add this information to
lib/JSON/LICENSE.txt.
Tobi