mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-10 17:43:46 +02:00
Fix JSON_USE_EXCEPTION=0 use case
This patch fixes the JSON_USE_EXCEPTION flag. Currently, due to the throwRuntimeError and throwLogicError methods implemented in json_value, even if JSON_USE_EXCEPTION is set to 0 jsoncpp will still throw. This breaks integration into projects with -fno-exceptions set, such as Chromium.
This commit is contained in:

committed by
Christopher Dunn

parent
5b91551f39
commit
83cc92161b
@@ -50,6 +50,7 @@
|
||||
*/
|
||||
namespace Json {
|
||||
|
||||
#if JSON_USE_EXCEPTION
|
||||
/** Base class for all exceptions we throw.
|
||||
*
|
||||
* We use nothing but these internally. Of course, STL can throw others.
|
||||
@@ -85,6 +86,7 @@ class JSON_API LogicError : public Exception {
|
||||
public:
|
||||
LogicError(String const& msg);
|
||||
};
|
||||
#endif
|
||||
|
||||
/// used internally
|
||||
JSONCPP_NORETURN void throwRuntimeError(String const& msg);
|
||||
|
Reference in New Issue
Block a user