summaryrefslogtreecommitdiff
path: root/upb/upb.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2013-05-28 13:44:50 -0700
committerJosh Haberman <jhaberman@gmail.com>2013-05-28 13:44:50 -0700
commitbada1e94f472e7507a97e7565369841b3d25c9b0 (patch)
tree1fe0882b497206db03e21eb87c975d5e400fe097 /upb/upb.h
parentee3a3191cda5faae5dcc9cd1526292c57f2be343 (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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/upb/upb.h b/upb/upb.h
index 86cae88..fcf1b65 100644
--- a/upb/upb.h
+++ b/upb/upb.h
@@ -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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback