Commit 9dadee8c authored by zhujiashun's avatar zhujiashun

Compatible with pb 3.8.0

parent 66578349
......@@ -14,6 +14,7 @@
#include "esp_message.h"
#include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge
#include <google/protobuf/wire_format.h> // WireFormatLite::GetTagWireType
namespace brpc {
......@@ -90,10 +91,7 @@ int EspMessage::ByteSize() const {
void EspMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const EspMessage* source =
::google::protobuf::internal::dynamic_cast_if_available<const EspMessage*>(
&from);
const EspMessage* source = dynamic_cast<const EspMessage*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
......
......@@ -135,8 +135,7 @@ int MemcacheRequest::ByteSize() const {
void MemcacheRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const MemcacheRequest* source =
::google::protobuf::internal::dynamic_cast_if_available<const MemcacheRequest*>(&from);
const MemcacheRequest* source = dynamic_cast<const MemcacheRequest*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
......@@ -264,8 +263,7 @@ int MemcacheResponse::ByteSize() const {
void MemcacheResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const MemcacheResponse* source =
::google::protobuf::internal::dynamic_cast_if_available<const MemcacheResponse*>(&from);
const MemcacheResponse* source = dynamic_cast<const MemcacheResponse*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
......
......@@ -15,7 +15,6 @@
// Authors: Ge,Jun (gejun@baidu.com)
#include <algorithm>
#include <google/protobuf/generated_message_reflection.h> // dynamic_cast_if_available
#include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge
#include <google/protobuf/wire_format.h>
#include "brpc/nshead_message.h"
......@@ -94,9 +93,7 @@ int NsheadMessage::ByteSize() const {
void NsheadMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const NsheadMessage* source =
::google::protobuf::internal::dynamic_cast_if_available<const NsheadMessage*>(
&from);
const NsheadMessage* source = dynamic_cast<const NsheadMessage*>(&from);
if (source == NULL) {
LOG(ERROR) << "Can only merge from NsheadMessage";
return;
......
......@@ -14,7 +14,6 @@
// 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 <gflags/gflags.h>
#include <butil/status.h>
......@@ -89,8 +88,7 @@ int RedisRequest::ByteSize() const {
void RedisRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RedisRequest* source =
::google::protobuf::internal::dynamic_cast_if_available<const RedisRequest*>(&from);
const RedisRequest* source = dynamic_cast<const RedisRequest*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
......@@ -308,8 +306,7 @@ int RedisResponse::ByteSize() const {
void RedisResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RedisResponse* source =
::google::protobuf::internal::dynamic_cast_if_available<const RedisResponse*>(&from);
const RedisResponse* source = dynamic_cast<const RedisResponse*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
......
......@@ -14,7 +14,6 @@
// Authors: Ge,Jun (gejun@baidu.com)
#include <google/protobuf/generated_message_reflection.h> // dynamic_cast_if_available
#include "brpc/serialized_request.h"
#include "butil/logging.h"
......@@ -94,9 +93,7 @@ void SerializedRequest::MergeFrom(const SerializedRequest&) {
void SerializedRequest::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
const SerializedRequest* source =
::google::protobuf::internal::dynamic_cast_if_available<const SerializedRequest*>(
&from);
const SerializedRequest* source = dynamic_cast<const SerializedRequest*>(&from);
if (source == NULL) {
CHECK(false) << "SerializedRequest can only CopyFrom SerializedRequest";
} 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