File tree 1 file changed +12
-8
lines changed 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 18
18
* for pre-condition violations and internal logic errors.
19
19
*/
20
20
#if JSON_USE_EXCEPTION
21
- #include < stdexcept>
22
- #define JSON_ASSERT (condition ) \
23
- {if (!(condition)) {throw std::logic_error ( " assert json failed" );}} // @todo <= add detail about condition in exception
24
- #define JSON_FAIL_MESSAGE (message ) \
21
+
22
+ // @todo <= add detail about condition in exception
23
+ # define JSON_ASSERT (condition ) \
24
+ {if (!(condition)) {Json::throwLogicError ( " assert json failed" );}}
25
+
26
+ # define JSON_FAIL_MESSAGE (message ) \
25
27
{ \
26
28
std::ostringstream oss; oss << message; \
27
- throw std::logic_error (oss.str ()); \
29
+ Json::throwLogicError (oss.str ()); \
30
+ abort (); \
28
31
}
29
- // #define JSON_FAIL_MESSAGE(message) throw std::logic_error(message)
32
+
30
33
#else // JSON_USE_EXCEPTION
31
- #define JSON_ASSERT (condition ) assert(condition)
34
+
35
+ # define JSON_ASSERT (condition ) assert(condition)
32
36
33
37
// The call to assert() will show the failure message in debug builds. In
34
38
// release builds we abort, for a core-dump or debugger.
35
- #define JSON_FAIL_MESSAGE (message ) \
39
+ # define JSON_FAIL_MESSAGE (message ) \
36
40
{ \
37
41
std::ostringstream oss; oss << message; \
38
42
assert (false && oss.str ().c_str ()); \
You can’t perform that action at this time.
0 commit comments