Commit 9dadee8c authored by zhujiashun's avatar zhujiashun

Compatible with pb 3.8.0

parent 66578349
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "esp_message.h" #include "esp_message.h"
#include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge
#include <google/protobuf/wire_format.h> // WireFormatLite::GetTagWireType #include <google/protobuf/wire_format.h> // WireFormatLite::GetTagWireType
namespace brpc { namespace brpc {
...@@ -90,10 +91,7 @@ int EspMessage::ByteSize() const { ...@@ -90,10 +91,7 @@ int EspMessage::ByteSize() const {
void EspMessage::MergeFrom(const ::google::protobuf::Message& from) { void EspMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this); GOOGLE_CHECK_NE(&from, this);
const EspMessage* source = const EspMessage* source = dynamic_cast<const EspMessage*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const EspMessage*>(
&from);
if (source == NULL) { if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this); ::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else { } else {
......
...@@ -135,8 +135,7 @@ int MemcacheRequest::ByteSize() const { ...@@ -135,8 +135,7 @@ int MemcacheRequest::ByteSize() const {
void MemcacheRequest::MergeFrom(const ::google::protobuf::Message& from) { void MemcacheRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this); GOOGLE_CHECK_NE(&from, this);
const MemcacheRequest* source = const MemcacheRequest* source = dynamic_cast<const MemcacheRequest*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const MemcacheRequest*>(&from);
if (source == NULL) { if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this); ::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else { } else {
...@@ -264,8 +263,7 @@ int MemcacheResponse::ByteSize() const { ...@@ -264,8 +263,7 @@ int MemcacheResponse::ByteSize() const {
void MemcacheResponse::MergeFrom(const ::google::protobuf::Message& from) { void MemcacheResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this); GOOGLE_CHECK_NE(&from, this);
const MemcacheResponse* source = const MemcacheResponse* source = dynamic_cast<const MemcacheResponse*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const MemcacheResponse*>(&from);
if (source == NULL) { if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this); ::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else { } else {
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// Authors: Ge,Jun (gejun@baidu.com) // Authors: Ge,Jun (gejun@baidu.com)
#include <algorithm> #include <algorithm>
#include <google/protobuf/generated_message_reflection.h> // dynamic_cast_if_available
#include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge #include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge
#include <google/protobuf/wire_format.h> #include <google/protobuf/wire_format.h>
#include "brpc/nshead_message.h" #include "brpc/nshead_message.h"
...@@ -94,9 +93,7 @@ int NsheadMessage::ByteSize() const { ...@@ -94,9 +93,7 @@ int NsheadMessage::ByteSize() const {
void NsheadMessage::MergeFrom(const ::google::protobuf::Message& from) { void NsheadMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this); GOOGLE_CHECK_NE(&from, this);
const NsheadMessage* source = const NsheadMessage* source = dynamic_cast<const NsheadMessage*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const NsheadMessage*>(
&from);
if (source == NULL) { if (source == NULL) {
LOG(ERROR) << "Can only merge from NsheadMessage"; LOG(ERROR) << "Can only merge from NsheadMessage";
return; return;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// Authors: Ge,Jun (gejun@baidu.com) // Authors: Ge,Jun (gejun@baidu.com)
#include <google/protobuf/generated_message_reflection.h> // dynamic_cast_if_available
#include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge #include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <butil/status.h> #include <butil/status.h>
...@@ -89,8 +88,7 @@ int RedisRequest::ByteSize() const { ...@@ -89,8 +88,7 @@ int RedisRequest::ByteSize() const {
void RedisRequest::MergeFrom(const ::google::protobuf::Message& from) { void RedisRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this); GOOGLE_CHECK_NE(&from, this);
const RedisRequest* source = const RedisRequest* source = dynamic_cast<const RedisRequest*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const RedisRequest*>(&from);
if (source == NULL) { if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this); ::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else { } else {
...@@ -308,8 +306,7 @@ int RedisResponse::ByteSize() const { ...@@ -308,8 +306,7 @@ int RedisResponse::ByteSize() const {
void RedisResponse::MergeFrom(const ::google::protobuf::Message& from) { void RedisResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this); GOOGLE_CHECK_NE(&from, this);
const RedisResponse* source = const RedisResponse* source = dynamic_cast<const RedisResponse*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const RedisResponse*>(&from);
if (source == NULL) { if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this); ::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else { } else {
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// Authors: Ge,Jun (gejun@baidu.com) // Authors: Ge,Jun (gejun@baidu.com)
#include <google/protobuf/generated_message_reflection.h> // dynamic_cast_if_available
#include "brpc/serialized_request.h" #include "brpc/serialized_request.h"
#include "butil/logging.h" #include "butil/logging.h"
...@@ -94,9 +93,7 @@ void SerializedRequest::MergeFrom(const SerializedRequest&) { ...@@ -94,9 +93,7 @@ void SerializedRequest::MergeFrom(const SerializedRequest&) {
void SerializedRequest::CopyFrom(const ::google::protobuf::Message& from) { void SerializedRequest::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return; if (&from == this) return;
const SerializedRequest* source = const SerializedRequest* source = dynamic_cast<const SerializedRequest*>(&from);
::google::protobuf::internal::dynamic_cast_if_available<const SerializedRequest*>(
&from);
if (source == NULL) { if (source == NULL) {
CHECK(false) << "SerializedRequest can only CopyFrom SerializedRequest"; CHECK(false) << "SerializedRequest can only CopyFrom SerializedRequest";
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment