File tree 1 file changed +12
-2
lines changed
src/viam/sdk/services/private
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 21
21
22
22
#include < viam/sdk/common/exception.hpp>
23
23
24
+ // As of proto version 27 (full version number 5.27) Arena::CreateMessage is deprecated in favor of
25
+ // Arena::Create. We use this macro to accomodate earlier supported versions of proto where
26
+ // CreateMessage was not yet deprecated, or where it was present but with different,
27
+ // non-substitutable semantics
28
+ #if GOOGLE_PROTOBUF_VERSION >= 5027000
29
+ #define VIAM_SDK_PB_CREATE_MESSAGE Create
30
+ #else
31
+ #define VIAM_SDK_PB_CREATE_MESSAGE CreateMessage
32
+ #endif
33
+
24
34
namespace viam {
25
35
namespace sdk {
26
36
namespace impl {
@@ -36,11 +46,11 @@ std::shared_ptr<MLModelService::named_tensor_views> MLModelServiceClient::infer(
36
46
namespace mlpb = ::viam::service::mlmodel::v1;
37
47
38
48
auto arena = std::make_unique<pb::Arena>();
39
- auto * const req = pb::Arena::CreateMessage <mlpb::InferRequest>(arena.get ());
49
+ auto * const req = pb::Arena::VIAM_SDK_PB_CREATE_MESSAGE <mlpb::InferRequest>(arena.get ());
40
50
41
51
req->set_name (this ->name ());
42
52
*req->mutable_extra () = map_to_struct (extra);
43
- auto * const resp = pb::Arena::CreateMessage <mlpb::InferResponse>(arena.get ());
53
+ auto * const resp = pb::Arena::VIAM_SDK_PB_CREATE_MESSAGE <mlpb::InferResponse>(arena.get ());
44
54
ClientContext ctx;
45
55
46
56
struct arena_and_views {
You can’t perform that action at this time.
0 commit comments