Before the change, an implicit Flush() will be triggered in the
destructor of the input stream. However, the return code of Flush() is
not discarded. This change makes sure when Flush() fails, we will
return false.
This fixes the following build error:
oldpwd=`pwd` && cd .../protobuf/src && \
$oldpwd/js_embed google/protobuf/compiler/js/well_known_types/any.js google/protobuf/compiler/js/well_known_types/struct.js google/protobuf/compiler/js/well_known_types/timestamp.js > $oldpwd/google/protobuf/compiler/js/well_known_types_embed.cc
/bin/bash: line 1: .../protobuf/target/src/google/protobuf/compiler/js/well_known_types_embed.cc: No such file or directory
Makefile:8201: recipe for target 'google/protobuf/compiler/js/well_known_types_embed.cc' failed
which is observed during the cross-compilation since the version 3.2.
This changes the linking error if php extension is not statically linked
to a runtime error. In this way, users who don't need Timestamp can
still use protobuf even if date extension is not statically linked in
php.
* Add discard unknown API in ruby.
* Add test for oneof message field.
* Add TestUnknown to represent unknown field data clearly.
* Only serialize the message with unknown fields itself in test.
* Move discard_unknown from Message to Google.Protobuf
* Recursively clear unknown fields in submessages.
* Recursively discard unknown fields in submsg for c extension
* Fix zts build
* Add comment for tests
* Add a TODO to add a util for encoding varint for better readability.
* Add test for oneof message field.
If the test cannot find a temp directory by
checking environment variables, it will fall back
to using the current working directory as the temp
directory root.
This is what the test used to do as of commit
6de51caed5
and what was then changed by commit
792d098769
Do not use "googletest.h", apprently that leads to
linking errors on Windows which I couldn't figure
out how to solve, and decided to just go with
plain gTest instead.
See https://github.com/google/protobuf/issues/3951
Add _file_desc_by_toplevel_extension back for compatibility issue with 3.4.1.
_file_desc_by_toplevel_extension is a temporary solution for FieldDescriptor.file.
FieldDescriptor.file was added in code gen. However, we need to keep it for some time for compatibility reason (with 3.4.1 only). May try to remove it after 2 years.