xref: /aosp_15_r20/external/grpc-grpc/include/grpcpp/impl/codegen/config_protobuf.h (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
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 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 #endif
75 
76 #ifndef GRPC_CUSTOM_JSONUTIL
77 #include <google/protobuf/util/json_util.h>
78 #include <google/protobuf/util/type_resolver_util.h>
79 
80 #include "absl/status/status.h"
81 #define GRPC_CUSTOM_JSONUTIL ::google::protobuf::util
82 #define GRPC_CUSTOM_UTIL_STATUS ::absl::Status
83 #endif
84 
85 namespace grpc {
86 namespace protobuf {
87 
88 typedef GRPC_CUSTOM_MESSAGE Message;
89 typedef GRPC_CUSTOM_MESSAGELITE MessageLite;
90 
91 typedef GRPC_CUSTOM_DESCRIPTOR Descriptor;
92 typedef GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool;
93 typedef GRPC_CUSTOM_DESCRIPTORDATABASE DescriptorDatabase;
94 #ifdef GRPC_PROTOBUF_EDITION_SUPPORT
95 typedef GRPC_CUSTOM_EDITION Edition;
96 #endif
97 typedef GRPC_CUSTOM_FIELDDESCRIPTOR FieldDescriptor;
98 typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor;
99 typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto;
100 typedef GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor;
101 typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor;
102 typedef GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE SimpleDescriptorDatabase;
103 typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation;
104 
105 namespace util {
106 typedef GRPC_CUSTOM_UTIL_STATUS Status;
107 }  // namespace util
108 
109 // NOLINTNEXTLINE(misc-unused-alias-decls)
110 namespace json = GRPC_CUSTOM_JSONUTIL;
111 
112 namespace io {
113 typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
114 typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
115 typedef GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream;
116 }  // namespace io
117 
118 }  // namespace protobuf
119 }  // namespace grpc
120 
121 #endif  // GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
122