Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 1 | From 7456d1621223d425b8a3fd74e435a79c046169fb Mon Sep 17 00:00:00 2001 |
| 2 | From: Robert Edmonds <edmonds@users.noreply.github.com> |
| 3 | Date: Wed, 10 Apr 2019 20:47:48 -0400 |
| 4 | Subject: [PATCH] t/generated-code2/cxx-generate-packed-data.cc: Fix build |
| 5 | failure on newer protobuf |
| 6 | |
| 7 | Upstream-Status: Backport [https://github.com/protobuf-c/protobuf-c/pull/369] |
| 8 | |
| 9 | google::protobuf::Message::Reflection has been removed in newer versions |
| 10 | of protobuf. The replacement is google::protobuf::Reflection. |
| 11 | |
| 12 | protobuf in commit 779f61c6a3ce02a119e28e802f229e61b69b9046 ("Integrate |
| 13 | recent changes from google3.", from August 2008) changed the following |
| 14 | in message.h: |
| 15 | |
| 16 | @@ -336,7 +337,8 @@ class LIBPROTOBUF_EXPORT Message { |
| 17 | |
| 18 | // Introspection --------------------------------------------------- |
| 19 | |
| 20 | - class Reflection; // Defined below. |
| 21 | + // Typedef for backwards-compatibility. |
| 22 | + typedef google::protobuf::Reflection Reflection; |
| 23 | |
| 24 | The "typedef for backwards-compatibility" apparently lasted ten years |
| 25 | until protobuf commit 6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 |
| 26 | ("Down-integrate from google3.", from August 2018) which finally removed |
| 27 | the typedef: |
| 28 | |
| 29 | @@ -327,8 +344,6 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite { |
| 30 | |
| 31 | // Introspection --------------------------------------------------- |
| 32 | |
| 33 | - // Typedef for backwards-compatibility. |
| 34 | - typedef google::protobuf::Reflection Reflection; |
| 35 | |
| 36 | This commit updates the only use of this typedef (in the test suite) to |
| 37 | directly refer to the replacement, google::protobuf::Reflection. This |
| 38 | fixes the build failure in the test suite. |
| 39 | --- |
| 40 | t/generated-code2/cxx-generate-packed-data.cc | 2 +- |
| 41 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 42 | |
| 43 | diff --git a/t/generated-code2/cxx-generate-packed-data.cc b/t/generated-code2/cxx-generate-packed-data.cc |
| 44 | index 4fd3e25..0865d2e 100644 |
| 45 | --- a/t/generated-code2/cxx-generate-packed-data.cc |
| 46 | +++ b/t/generated-code2/cxx-generate-packed-data.cc |
| 47 | @@ -998,7 +998,7 @@ static void dump_test_packed_repeated_enum (void) |
| 48 | static void dump_test_unknown_fields (void) |
| 49 | { |
| 50 | EmptyMess mess; |
| 51 | - const google::protobuf::Message::Reflection *reflection = mess.GetReflection(); |
| 52 | + const google::protobuf::Reflection *reflection = mess.GetReflection(); |
| 53 | google::protobuf::UnknownFieldSet *fs = reflection->MutableUnknownFields(&mess); |
| 54 | |
| 55 | #if GOOGLE_PROTOBUF_VERSION >= 2001000 |