Skip to content

Commit

Permalink
There is no compatible way to detect gRPC version.
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Nov 16, 2023
1 parent 4301f23 commit 1862010
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions exporters/otlp/test/otlp_grpc_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,8 @@ class OtlpMockTraceServiceStub : public proto::collector::trace::v1::MockTraceSe
OtlpMockTraceServiceStub *stub_;
};

# if (GRPC_CPP_VERSION_MAJOR * 1000 + GRPC_CPP_VERSION_MINOR) >= 1039
async_interface_base *async() override { return &async_interface_; }
# else
async_interface_base *experimental_async() override { return &async_interface_; }
# endif
async_interface_base *async() { return &async_interface_; }
async_interface_base *experimental_async() { return &async_interface_; }

::grpc::Status GetLastAsyncStatus() const noexcept { return last_async_status_; }

Expand Down
14 changes: 4 additions & 10 deletions exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@ class OtlpMockTraceServiceStub : public proto::collector::trace::v1::MockTraceSe
OtlpMockTraceServiceStub *stub_;
};

#if (GRPC_CPP_VERSION_MAJOR * 1000 + GRPC_CPP_VERSION_MINOR) >= 1039
async_interface_base *async() override { return &async_interface_; }
#else
async_interface_base *experimental_async() override { return &async_interface_; }
#endif
async_interface_base *async() { return &async_interface_; }
async_interface_base *experimental_async() { return &async_interface_; }

::grpc::Status GetLastAsyncStatus() const noexcept { return last_async_status_; }

Expand Down Expand Up @@ -159,11 +156,8 @@ class OtlpMockLogsServiceStub : public proto::collector::logs::v1::MockLogsServi
OtlpMockLogsServiceStub *stub_;
};

#if (GRPC_CPP_VERSION_MAJOR * 1000 + GRPC_CPP_VERSION_MINOR) >= 1039
async_interface_base *async() override { return &async_interface_; }
#else
async_interface_base *experimental_async() override { return &async_interface_; }
#endif
async_interface_base *async() { return &async_interface_; }
async_interface_base *experimental_async() { return &async_interface_; }

::grpc::Status GetLastAsyncStatus() const noexcept { return last_async_status_; }

Expand Down

0 comments on commit 1862010

Please sign in to comment.