Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/generated-code2/cxx-generate-packed-data.cc: Fix build failure on newer protobuf #369

Merged
merged 1 commit into from Apr 11, 2019

Conversation

edmonds
Copy link
Member

@edmonds edmonds commented Apr 11, 2019

google::protobuf::Message::Reflection has been removed in newer versions
of protobuf. The replacement is google::protobuf::Reflection.

protobuf in commit protocolbuffers/protobuf@779f61c ("Integrate recent changes from google3.", from August 2008) changed the following in message.h:

@@ -336,7 +337,8 @@ class LIBPROTOBUF_EXPORT Message {

   // Introspection ---------------------------------------------------

-  class Reflection;  // Defined below.
+  // Typedef for backwards-compatibility.
+  typedef google::protobuf::Reflection Reflection;

The "typedef for backwards-compatibility" apparently lasted ten years until protobuf commit protocolbuffers/protobuf@6bbe197 ("Down-integrate from google3.", from August 2018) which finally removed the typedef:

@@ -327,8 +344,6 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {

   // Introspection ---------------------------------------------------

-  // Typedef for backwards-compatibility.
-  typedef google::protobuf::Reflection Reflection;

This commit updates the only use of this typedef (in the test suite) to directly refer to the replacement, google::protobuf::Reflection. This fixes the build failure in the test suite.

…ewer protobuf

google::protobuf::Message::Reflection has been removed in newer versions
of protobuf. The replacement is google::protobuf::Reflection.

protobuf in commit 779f61c6a3ce02a119e28e802f229e61b69b9046 ("Integrate
recent changes from google3.", from August 2008) changed the following
in message.h:

    @@ -336,7 +337,8 @@ class LIBPROTOBUF_EXPORT Message {

       // Introspection ---------------------------------------------------

    -  class Reflection;  // Defined below.
    +  // Typedef for backwards-compatibility.
    +  typedef google::protobuf::Reflection Reflection;

The "typedef for backwards-compatibility" apparently lasted ten years
until protobuf commit 6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3
("Down-integrate from google3.", from August 2018) which finally removed
the typedef:

    @@ -327,8 +344,6 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {

       // Introspection ---------------------------------------------------

    -  // Typedef for backwards-compatibility.
    -  typedef google::protobuf::Reflection Reflection;

This commit updates the only use of this typedef (in the test suite) to
directly refer to the replacement, google::protobuf::Reflection. This
fixes the build failure in the test suite.
@edmonds edmonds added this to the 1.3.2 milestone Apr 11, 2019
@edmonds
Copy link
Member Author

edmonds commented Apr 11, 2019

Also, since google::protobuf::Reflection has existed for so long (the backwards compatibility typedef existed for nearly ten years), this means it's safe to make this change without breaking protobuf-c when built against older versions of protobuf.

@edmonds edmonds merged commit 9412830 into next Apr 11, 2019
@edmonds edmonds deleted the edmonds/protobuf-reflection-typedef-test-fix branch April 11, 2019 01:43
@edmonds edmonds mentioned this pull request Apr 11, 2019
@rvolosatovs
Copy link

Any idea when this will land in a release?

@rvolosatovs rvolosatovs mentioned this pull request May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants