diff options
author | John Cater <jcater@google.com> | 2017-10-30 15:05:50 -0400 |
---|---|---|
committer | John Cater <jcater@google.com> | 2017-10-30 19:35:44 -0400 |
commit | fadeb90a05321195a969ae526ee8cbfea5db6cc6 (patch) | |
tree | c130e844686e3f6764852004f5aabfb2783c0329 /third_party/grpc | |
parent | 6163d43bada9d6876025200907c8177a371dbe9a (diff) |
Fix unused attribute test to be cross-platform.
Change-Id: I487b1a3142215301b57d5f13bd4e9a78fd756f62
Diffstat (limited to 'third_party/grpc')
-rw-r--r-- | third_party/grpc/src/cpp/client/create_channel.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/third_party/grpc/src/cpp/client/create_channel.cc b/third_party/grpc/src/cpp/client/create_channel.cc index bb8b201cdf..a1b65af71d 100644 --- a/third_party/grpc/src/cpp/client/create_channel.cc +++ b/third_party/grpc/src/cpp/client/create_channel.cc @@ -50,11 +50,18 @@ std::shared_ptr<Channel> CreateChannel( return CreateCustomChannel(target, creds, ChannelArguments()); } +// GCC-specific features +#if (defined(COMPILER_GCC3) || defined(__APPLE__)) && !defined(SWIG) +#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#else // Not GCC +#define ATTRIBUTE_UNUSED +#endif // GCC + std::shared_ptr<Channel> CreateCustomChannel( const grpc::string& target, const std::shared_ptr<ChannelCredentials>& creds, const ChannelArguments& args) { - __attribute__((unused)) internal::GrpcLibrary + ATTRIBUTE_UNUSED internal::GrpcLibrary init_lib; // We need to call init in case of a bad creds. ChannelArguments cp_args = args; std::ostringstream user_agent_prefix; |