• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
19 #ifndef GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
20 #define GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
21 
22 // IWYU pragma: private
23 
24 // #define GRPC_OPEN_SOURCE_PROTO
25 
26 #define GRPC_PROTOBUF_CORD_SUPPORT_ENABLED
27 
28 #ifndef GRPC_CUSTOM_MESSAGE
29 #ifdef GRPC_USE_PROTO_LITE
30 #include <google/protobuf/message_lite.h>
31 #define GRPC_CUSTOM_MESSAGE ::google::protobuf::MessageLite
32 #define GRPC_CUSTOM_MESSAGELITE ::google::protobuf::MessageLite
33 #else
34 #include <google/protobuf/message.h>
35 #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
36 #define GRPC_CUSTOM_MESSAGELITE ::google::protobuf::MessageLite
37 #endif
38 #endif
39 
40 #ifndef GRPC_CUSTOM_DESCRIPTOR
41 #include <google/protobuf/descriptor.h>
42 #include <google/protobuf/descriptor.pb.h>
43 #if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 4025000
44 #define GRPC_PROTOBUF_EDITION_SUPPORT
45 #endif
46 #define GRPC_CUSTOM_DESCRIPTOR ::google::protobuf::Descriptor
47 #define GRPC_CUSTOM_DESCRIPTORPOOL ::google::protobuf::DescriptorPool
48 #ifdef GRPC_PROTOBUF_EDITION_SUPPORT
49 #define GRPC_CUSTOM_EDITION ::google::protobuf::Edition
50 #endif
51 #define GRPC_CUSTOM_FIELDDESCRIPTOR ::google::protobuf::FieldDescriptor
52 #define GRPC_CUSTOM_FILEDESCRIPTOR ::google::protobuf::FileDescriptor
53 #define GRPC_CUSTOM_FILEDESCRIPTORPROTO ::google::protobuf::FileDescriptorProto
54 #define GRPC_CUSTOM_METHODDESCRIPTOR ::google::protobuf::MethodDescriptor
55 #define GRPC_CUSTOM_SERVICEDESCRIPTOR ::google::protobuf::ServiceDescriptor
56 #define GRPC_CUSTOM_SOURCELOCATION ::google::protobuf::SourceLocation
57 #endif
58 
59 #ifndef GRPC_CUSTOM_DESCRIPTORDATABASE
60 #include <google/protobuf/descriptor_database.h>
61 #define GRPC_CUSTOM_DESCRIPTORDATABASE ::google::protobuf::DescriptorDatabase
62 #define GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE \
63   ::google::protobuf::SimpleDescriptorDatabase
64 #endif
65 
66 #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
67 #include <google/protobuf/io/coded_stream.h>
68 #include <google/protobuf/io/zero_copy_stream.h>
69 #define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \
70   ::google::protobuf::io::ZeroCopyOutputStream
71 #define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \
72   ::google::protobuf::io::ZeroCopyInputStream
73 #define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream
74 #define GRPC_CUSTOM_CODEDOUTPUTSTREAM ::google::protobuf::io::CodedOutputStream
75 #endif
76 
77 #ifndef GRPC_CUSTOM_JSONUTIL
78 #include <google/protobuf/util/json_util.h>
79 #include <google/protobuf/util/type_resolver_util.h>
80 
81 #include "absl/status/status.h"
82 #define GRPC_CUSTOM_JSONUTIL ::google::protobuf::util
83 #define GRPC_CUSTOM_UTIL_STATUS ::absl::Status
84 #endif
85 
86 namespace grpc {
87 namespace protobuf {
88 
89 typedef GRPC_CUSTOM_MESSAGE Message;
90 typedef GRPC_CUSTOM_MESSAGELITE MessageLite;
91 
92 typedef GRPC_CUSTOM_DESCRIPTOR Descriptor;
93 typedef GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool;
94 typedef GRPC_CUSTOM_DESCRIPTORDATABASE DescriptorDatabase;
95 #ifdef GRPC_PROTOBUF_EDITION_SUPPORT
96 typedef GRPC_CUSTOM_EDITION Edition;
97 #endif
98 typedef GRPC_CUSTOM_FIELDDESCRIPTOR FieldDescriptor;
99 typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor;
100 typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto;
101 typedef GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor;
102 typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor;
103 typedef GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE SimpleDescriptorDatabase;
104 typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation;
105 
106 namespace util {
107 typedef GRPC_CUSTOM_UTIL_STATUS Status;
108 }  // namespace util
109 
110 // NOLINTNEXTLINE(misc-unused-alias-decls)
111 namespace json = GRPC_CUSTOM_JSONUTIL;
112 
113 namespace io {
114 typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
115 typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
116 typedef GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream;
117 typedef GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream;
118 }  // namespace io
119 
120 }  // namespace protobuf
121 }  // namespace grpc
122 
123 #endif  // GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
124