summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
Diffstat (limited to 'json')
-rw-r--r--json/json.h4
-rw-r--r--json/jsoncpp.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/json/json.h b/json/json.h
index 399de6ca..8208038b 100644
--- a/json/json.h
+++ b/json/json.h
@@ -469,6 +469,7 @@ public:
#if !defined(JSON_IS_AMALGAMATION)
#include "forwards.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <stdexcept>
#include <exception>
#include <string>
#include <vector>
@@ -502,11 +503,12 @@ public:
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#ifndef JSONCPP_EXCEPTION
// XXX: BN: Use our exception class for extra details
#include "../exceptions.h"
#define JSONCPP_EXCEPTION ExceptionWithStackTrace
// #define JSONCPP_EXCEPTION std::runtime_error
-
+#endif
#pragma pack(push, 8)
diff --git a/json/jsoncpp.cpp b/json/jsoncpp.cpp
index 307cf560..f6661c6a 100644
--- a/json/jsoncpp.cpp
+++ b/json/jsoncpp.cpp
@@ -2654,7 +2654,7 @@ static inline void releaseStringValue(char* value, unsigned) { free(value); }
namespace Json {
// BN: subclass
-Exception::Exception(JSONCPP_STRING const& msg) : JSONCPP_EXCEPTION(msg) {}
+Exception::Exception(JSONCPP_STRING const& msg) : JSONCPP_EXCEPTION(msg.c_str()) {}
Exception::~Exception() JSONCPP_NOEXCEPT {}
// BN: removed what()
RuntimeError::RuntimeError(JSONCPP_STRING const& msg) : Exception(msg) {}