diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-10-26 14:41:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-26 14:41:43 -0700 |
commit | 23adfeb00327fbdccacc99806acb1a9a073bd8e0 (patch) | |
tree | f56e93003569b065b7c2fd191e97763e9c1738ab /ruby/ext/google/protobuf_c/protobuf.h | |
parent | a08b03d4c00a5793b88b494f672513f6ad46a681 (diff) | |
download | protobuf-23adfeb00327fbdccacc99806acb1a9a073bd8e0.tar.gz protobuf-23adfeb00327fbdccacc99806acb1a9a073bd8e0.tar.bz2 protobuf-23adfeb00327fbdccacc99806acb1a9a073bd8e0.zip |
Reserve unknown in Ruby (#3763)
* Reserve unknown in ruby
* Revert ruby tests. Wait for cpp impl for conformance test
* Add conformance test for preserving unknown
* Add unknown field conformance test to csharp failure list.
* Fix comments
* Fix comment
* Fix comments
* Fix typo
* Use stringsink_string directly
* Mark hd unused
* Remove unused encodeunknown_handlerfunc
Diffstat (limited to 'ruby/ext/google/protobuf_c/protobuf.h')
-rw-r--r-- | ruby/ext/google/protobuf_c/protobuf.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ruby/ext/google/protobuf_c/protobuf.h b/ruby/ext/google/protobuf_c/protobuf.h index 21c7f001..1291ac59 100644 --- a/ruby/ext/google/protobuf_c/protobuf.h +++ b/ruby/ext/google/protobuf_c/protobuf.h @@ -475,8 +475,20 @@ VALUE layout_inspect(MessageLayout* layout, void* storage); // Message class creation. // ----------------------------------------------------------------------------- +// This should probably be factored into a common upb component. + +typedef struct { + upb_byteshandler handler; + upb_bytessink sink; + char *ptr; + size_t len, size; +} stringsink; + +void stringsink_uninit(stringsink *sink); + struct MessageHeader { - Descriptor* descriptor; // kept alive by self.class.descriptor reference. + Descriptor* descriptor; // kept alive by self.class.descriptor reference. + stringsink* unknown_fields; // store unknown fields in decoding. // Data comes after this. }; |