From 5872a659d1e7e66b39e481e306cf3be427a8b2b4 Mon Sep 17 00:00:00 2001 From: wangguibao Date: Thu, 26 Sep 2019 11:31:16 +0800 Subject: [PATCH] Fix code --- cube/cube-api/include/cube_api.h | 5 +++++ cube/cube-api/include/meta.h | 14 ++++++++++++++ cube/cube-api/src/cube_api.cpp | 10 ++++++++++ cube/cube-api/src/meta.cpp | 4 ++++ 4 files changed, 33 insertions(+) diff --git a/cube/cube-api/include/cube_api.h b/cube/cube-api/include/cube_api.h index aee82f6d..c5059b9f 100644 --- a/cube/cube-api/include/cube_api.h +++ b/cube/cube-api/include/cube_api.h @@ -18,7 +18,12 @@ #include #include +#ifdef BCLOUD +#include "baidu/rpc/server.h" +#else #include "brpc/server.h" +#endif + #include "cube/cube-api/cube.pb.h" #include "cube/cube-api/include/meta.h" diff --git a/cube/cube-api/include/meta.h b/cube/cube-api/include/meta.h index ec891720..69bbb8cc 100644 --- a/cube/cube-api/include/meta.h +++ b/cube/cube-api/include/meta.h @@ -19,11 +19,25 @@ #include #include +#ifdef BCLOUD +#include "baidu/rpc/channel.h" +#include "baidu/rpc/parallel_channel.h" +#include "rapidjson/document.h" +#else #include "brpc/channel.h" #include "brpc/parallel_channel.h" #include "butil/third_party/rapidjson/document.h" +#endif + #include "bvar/bvar.h" +#ifdef BCLOUD +namespace brpc = baidu::rpc; +#ifndef BUTIL_RAPIDJSON_NAMESPACE +#define BUTIL_RAPIDJSON_NAMESPACE RAPIDJSON_NAMESPACE +#endif +#endif + namespace rec { namespace mcube { diff --git a/cube/cube-api/src/cube_api.cpp b/cube/cube-api/src/cube_api.cpp index 8a9cebb9..c481effa 100644 --- a/cube/cube-api/src/cube_api.cpp +++ b/cube/cube-api/src/cube_api.cpp @@ -13,8 +13,14 @@ // limitations under the License. #include "cube/cube-api/include/cube_api.h" +#ifdef BCLOUD +#include +#include +#else #include #include +#endif + #include #include "cube/cube-api/include/cube_api_bvar.h" @@ -25,6 +31,10 @@ namespace { static ::rec::mcube::CubeAPI* g_ins = NULL; } +#ifdef BCLOUD +namespace brpc = baidu::rpc; +#endif + namespace rec { namespace mcube { diff --git a/cube/cube-api/src/meta.cpp b/cube/cube-api/src/meta.cpp index 69ce43a0..06911e88 100644 --- a/cube/cube-api/src/meta.cpp +++ b/cube/cube-api/src/meta.cpp @@ -26,6 +26,10 @@ namespace { static ::rec::mcube::Meta* g_ins = NULL; } +#ifdef BCLOUD +namespace brpc = baidu::rpc; +#endif + namespace rec { namespace mcube { -- GitLab