From 8d1ee6d06ffdf84a33bd083463663ece5fb9e7a9 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Thu, 28 Nov 2024 13:51:33 +0800 Subject: [PATCH] Support Protobuf v29 close #2829 * https://github.com/protocolbuffers/protobuf/commit/a626dd332f177e110afd3eef71728e5951d8f3a0 * https://github.com/protocolbuffers/protobuf/commit/49bb305147392ecdc65234b4b03b51de66e02e48 --- src/brpc/nonreflectable_message.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/brpc/nonreflectable_message.h b/src/brpc/nonreflectable_message.h index 91de918ba0..495e187407 100644 --- a/src/brpc/nonreflectable_message.h +++ b/src/brpc/nonreflectable_message.h @@ -51,7 +51,11 @@ class NonreflectableMessage : public ::google::protobuf::Message { return *this; } -#if GOOGLE_PROTOBUF_VERSION >= 5026000 +#if GOOGLE_PROTOBUF_VERSION >= 5029000 + const ::google::protobuf::internal::ClassData* GetClassData() const override { + return nullptr; + } +#elif GOOGLE_PROTOBUF_VERSION >= 5026000 const ClassData* GetClassData() const override { return nullptr; } @@ -63,7 +67,7 @@ class NonreflectableMessage : public ::google::protobuf::Message { } #endif -#if GOOGLE_PROTOBUF_VERSION >= 3000000 +#if GOOGLE_PROTOBUF_VERSION >= 3000000 && GOOGLE_PROTOBUF_VERSION < 5029000 Message* New(::google::protobuf::Arena* arena) const override { return ::google::protobuf::Arena::Create(arena); }