diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2018-08-29 15:57:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 15:57:00 -0700 |
commit | 6c4469e1895298f0965777b2f9597a82a480cebd (patch) | |
tree | f97dd2b88aa4567477497629af9a1d3df49d09fd /upb/def.c | |
parent | 62318cadcefec2d2bfd0d84fdd628be313ff6201 (diff) |
Fix json encoding/decoding for duration. (#118)
* Fix json encoding/decoding for duration.
* Use lld for int64_t
* Cast int64_t to long
Diffstat (limited to 'upb/def.c')
-rw-r--r-- | upb/def.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1337,6 +1337,7 @@ bool upb_fielddef_checkdescriptortype(int32_t type) { /* upb_msgdef *****************************************************************/ +static const char *kDurationFullMessageName = "google.protobuf.Duration"; static const char *kTimestampFullMessageName = "google.protobuf.Timestamp"; static void visitmsg(const upb_refcounted *r, upb_refcounted_visit *visit, @@ -1595,6 +1596,10 @@ bool upb_msgdef_mapentry(const upb_msgdef *m) { return m->map_entry; } +bool upb_msgdef_duration(const upb_msgdef *m) { + return strcmp(upb_msgdef_fullname(m), kDurationFullMessageName) == 0; +} + bool upb_msgdef_timestamp(const upb_msgdef *m) { return strcmp(upb_msgdef_fullname(m), kTimestampFullMessageName) == 0; } |