config_protobuf.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. //
  3. // Copyright 2015 gRPC authors.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. //
  17. //
  18. #ifndef GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
  19. #define GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
  20. // IWYU pragma: private
  21. #define GRPC_OPEN_SOURCE_PROTO
  22. #ifndef GRPC_CUSTOM_MESSAGE
  23. #ifdef GRPC_USE_PROTO_LITE
  24. #include <google/protobuf/message_lite.h>
  25. #define GRPC_CUSTOM_MESSAGE ::google::protobuf::MessageLite
  26. #define GRPC_CUSTOM_MESSAGELITE ::google::protobuf::MessageLite
  27. #else
  28. #include <google/protobuf/message.h>
  29. #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
  30. #define GRPC_CUSTOM_MESSAGELITE ::google::protobuf::MessageLite
  31. #endif
  32. #endif
  33. #ifndef GRPC_CUSTOM_DESCRIPTOR
  34. #include <google/protobuf/descriptor.h>
  35. #include <google/protobuf/descriptor.pb.h>
  36. #define GRPC_CUSTOM_DESCRIPTOR ::google::protobuf::Descriptor
  37. #define GRPC_CUSTOM_DESCRIPTORPOOL ::google::protobuf::DescriptorPool
  38. #define GRPC_CUSTOM_FIELDDESCRIPTOR ::google::protobuf::FieldDescriptor
  39. #define GRPC_CUSTOM_FILEDESCRIPTOR ::google::protobuf::FileDescriptor
  40. #define GRPC_CUSTOM_FILEDESCRIPTORPROTO ::google::protobuf::FileDescriptorProto
  41. #define GRPC_CUSTOM_METHODDESCRIPTOR ::google::protobuf::MethodDescriptor
  42. #define GRPC_CUSTOM_SERVICEDESCRIPTOR ::google::protobuf::ServiceDescriptor
  43. #define GRPC_CUSTOM_SOURCELOCATION ::google::protobuf::SourceLocation
  44. #endif
  45. #ifndef GRPC_CUSTOM_DESCRIPTORDATABASE
  46. #include <google/protobuf/descriptor_database.h>
  47. #define GRPC_CUSTOM_DESCRIPTORDATABASE ::google::protobuf::DescriptorDatabase
  48. #define GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE \
  49. ::google::protobuf::SimpleDescriptorDatabase
  50. #endif
  51. #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
  52. #include <google/protobuf/io/coded_stream.h>
  53. #include <google/protobuf/io/zero_copy_stream.h>
  54. #define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \
  55. ::google::protobuf::io::ZeroCopyOutputStream
  56. #define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \
  57. ::google::protobuf::io::ZeroCopyInputStream
  58. #define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream
  59. #endif
  60. #ifndef GRPC_CUSTOM_JSONUTIL
  61. #include <google/protobuf/util/json_util.h>
  62. #include <google/protobuf/util/type_resolver_util.h>
  63. #include <y_absl/status/status.h>
  64. #define GRPC_CUSTOM_JSONUTIL ::google::protobuf::util
  65. #define GRPC_CUSTOM_UTIL_STATUS y_absl::Status
  66. #endif
  67. namespace grpc {
  68. namespace protobuf {
  69. typedef GRPC_CUSTOM_MESSAGE Message;
  70. typedef GRPC_CUSTOM_MESSAGELITE MessageLite;
  71. typedef GRPC_CUSTOM_DESCRIPTOR Descriptor;
  72. typedef GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool;
  73. typedef GRPC_CUSTOM_DESCRIPTORDATABASE DescriptorDatabase;
  74. typedef GRPC_CUSTOM_FIELDDESCRIPTOR FieldDescriptor;
  75. typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor;
  76. typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto;
  77. typedef GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor;
  78. typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor;
  79. typedef GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE SimpleDescriptorDatabase;
  80. typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation;
  81. namespace util {
  82. typedef GRPC_CUSTOM_UTIL_STATUS Status;
  83. } // namespace util
  84. // NOLINTNEXTLINE(misc-unused-alias-decls)
  85. namespace json = GRPC_CUSTOM_JSONUTIL;
  86. namespace io {
  87. typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
  88. typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
  89. typedef GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream;
  90. } // namespace io
  91. } // namespace protobuf
  92. } // namespace grpc
  93. #endif // GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H