diff options
author | Josh Haberman <jhaberman@gmail.com> | 2013-05-28 13:44:50 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2013-05-28 13:44:50 -0700 |
commit | bada1e94f472e7507a97e7565369841b3d25c9b0 (patch) | |
tree | 1fe0882b497206db03e21eb87c975d5e400fe097 /upb/upb.h | |
parent | ee3a3191cda5faae5dcc9cd1526292c57f2be343 (diff) |
Merge from Google-internal development.
- Better error reporting for upb::Def setters.
- error reporting for upb::Handlers setters.
- made the start/endmsg handlers a little less special-cased.
Diffstat (limited to 'upb/upb.h')
-rw-r--r-- | upb/upb.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -163,6 +163,13 @@ char *upb_strdup(const char *s); // debug mode. #define UPB_ASSERT_VAR(var, predicate) UPB_UNUSED(var); assert(predicate) +#define UPB_ASSERT_STATUS(status) do { \ + if (!upb_ok(status)) { \ + fprintf(stderr, "upb status failure: %s\n", upb_status_getstr(status)); \ + assert(upb_ok(status)); \ + } \ + } while (0) + // The maximum that any submessages can be nested. Matches proto2's limit. // At the moment this specifies the size of several statically-sized arrays // and therefore setting it high will cause more memory to be used. Will |