You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue of switching throw to abort is similar to #117 and #118.
In this assignment, replace throw with a macro so that exception messages can be handled by the application.
Prepare a macro named PICOJSON_THROW.
// add new macro
#ifndef PICOJSON_THROW
#definePICOJSON_THROW(e, m) throwe(m)
#endif
// replace throw
#ifndef PICOJSON_ASSERT
#definePICOJSON_ASSERT(e) \
do { \
if (!(e)) \
PICOJSON_THROW(std::runtime_error, #e); \
} while (0)
#endif
The application side overwrites abort and assert to use it. #define PICOJSON_THROW(e, m) { puts(#e ":" m); abort(); }
The text was updated successfully, but these errors were encountered:
shun126
added a commit
to shun126/picojson
that referenced
this issue
Jul 10, 2022
The issue of switching throw to abort is similar to #117 and #118.
In this assignment, replace throw with a macro so that exception messages can be handled by the application.
Prepare a macro named
PICOJSON_THROW
.The application side overwrites abort and assert to use it.
#define PICOJSON_THROW(e, m) { puts(#e ":" m); abort(); }
The text was updated successfully, but these errors were encountered: