trezor: add #if for ByteSizeLong

Turns out Ubuntu 18.04 ships with an old protobuf version.
This commit is contained in:
selsta 2021-06-24 17:16:48 +02:00
parent 282e2ef058
commit 8ae6c85efd
No known key found for this signature in database
GPG Key ID: 2EA0A99A8B07AE5E
1 changed files with 4 additions and 0 deletions

View File

@ -157,7 +157,11 @@ namespace trezor{
#define PROTO_HEADER_SIZE 6
static size_t message_size(const google::protobuf::Message &req){
#if GOOGLE_PROTOBUF_VERSION < 3006001
return size_t(req.ByteSize());
#else
return req.ByteSizeLong();
#endif
}
static size_t serialize_message_buffer_size(size_t msg_size) {