From: Aaron J. <ja...@go...> - 2011-05-24 22:27:43
|
Ah right, I see. I actually fixed this by adding braces in the SVN commit I made, but if you want me to add a function I can. On Wed, May 25, 2011 at 1:43 AM, Baptiste Lepilleur <bap...@gm...> wrote: > > > 2011/5/24 Aaron Jacobs <ja...@go...> >> >> On Tue, May 24, 2011 at 3:06 AM, Baptiste Lepilleur >> <bap...@gm...> wrote: >> [...] >> > - JSON_FAIL_MESSAGE is bugged if there is no exception (e.g. >> > multi-statements). IMHO it should just call a function that dump message >> > and >> > then call abort(). >> >> Sorry, I'm not sure I understand the first sentence here. Could you >> clarify? > > Sorry, I should have made this clearer: > #define JSON_FAIL_MESSAGE( message ) std::cerr << message; exit(123); > with: > if (!ok) JSON_FAIL_MESSAGE(reader.getFormattedErrorMessages()); > will becomes: > if (!ok) > std::cerr << message; > exit(123); > A simple way to avoid this is: > #define JSON_FAIL_MESSAGE( message ) onJsonFailure( message ); > Baptiste. > |