Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/28287 )
Change subject: misc: Use the protobuf version to choose between
ByteSize(Long).
......................................................................
misc: Use the protobuf version to choose between ByteSize(Long).
Older versions of protobuf are apparently still what's provided with
some current versions of some distributions. To avoid breaking the build
on those distributions and to avoid an annoying deprecation warning on
newer systems, check GOOGLE_PROTOBUF_VERSION to choose which to use.
According to the CHANGES.txt file here:
https://github.com/protocolbuffers/protobuf/blob/master/CHANGES.txt
The new ByteSizeLong function was introduced in version 3.1.0 in 2016.
Change-Id: I7f8eeda144bf9556d17d7a0a741996f3137b48b4
---
M src/proto/protoio.cc
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/proto/protoio.cc b/src/proto/protoio.cc
index 2efcc27..691d4ee 100644
--- a/src/proto/protoio.cc
+++ b/src/proto/protoio.cc
@@ -87,7 +87,12 @@
io::CodedOutputStream codedStream(zeroCopyStream);
// Write the size of the message to the stream
- codedStream.WriteVarint32(msg.ByteSizeLong());
+# if GOOGLE_PROTOBUF_VERSION < 3001000
+ auto msg_size = msg.ByteSize();
+# else
+ auto msg_size = msg.ByteSizeLong();
+# endif
+ codedStream.WriteVarint32(msg_size);
// Write the message itself to the stream
msg.SerializeWithCachedSizes(&codedStream);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/28287
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I7f8eeda144bf9556d17d7a0a741996f3137b48b4
Gerrit-Change-Number: 28287
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s