aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/patches/03-sysheader.patch
blob: 6280a95b9f8080f02b521ff587b13185824d90a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
diff --git a/include/grpcpp/grpcpp.h b/include/grpcpp/grpcpp.h
index aa8a242..39b7296 100644
--- a/include/grpcpp/grpcpp.h
+++ b/include/grpcpp/grpcpp.h
@ -19,6 +19,11 @@
 #ifndef GRPCPP_SERVER_H
 #define GRPCPP_SERVER_H

+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
+
 #include <list>
 #include <memory>
 #include <vector>
diff --git a/include/grpcpp/impl/codegen/async_stream.h b/include/grpcpp/impl/codegen/async_stream.h
index bfb2df4..4d66ec9 100644
--- a/include/grpcpp/impl/codegen/async_stream.h
+++ b/include/grpcpp/impl/codegen/async_stream.h
@ -18,6 +18,10 @@
 #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
 #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H

+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #include <grpcpp/impl/codegen/call.h>
 #include <grpcpp/impl/codegen/channel_interface.h>
 #include <grpcpp/impl/codegen/core_codegen_interface.h>
diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h
index 4ca87a9..7c03e09 100644
--- a/include/grpcpp/impl/codegen/call_op_set.h
+++ b/include/grpcpp/impl/codegen/call_op_set.h
@@ -16,6 +16,10 @@
 //
 //
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
 #define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
 
diff --git a/include/grpcpp/impl/codegen/callback_common.h b/include/grpcpp/impl/codegen/callback_common.h
index a3c8c41..77f9c24 100644
--- a/include/grpcpp/impl/codegen/callback_common.h
+++ b/include/grpcpp/impl/codegen/callback_common.h
@@ -16,6 +16,10 @@
 //
 //
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
 #define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
 
diff --git a/include/grpcpp/impl/codegen/channel_interface.h b/include/grpcpp/impl/codegen/channel_interface.h
index 5353f5f..03fbda0 100644
--- a/include/grpcpp/impl/codegen/channel_interface.h
+++ b/include/grpcpp/impl/codegen/channel_interface.h
@@ -16,6 +16,10 @@
 //
 //
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #ifndef GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
 #define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
 
diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h
index 8ed8423..0ca3fc7 100644
--- a/include/grpcpp/impl/codegen/interceptor_common.h
+++ b/include/grpcpp/impl/codegen/interceptor_common.h
@@ -16,6 +16,10 @@
 //
 //
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
 #define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
 
diff --git a/include/grpcpp/impl/codegen/time.h b/include/grpcpp/impl/codegen/time.h
index c32f254..46a4ccf 100644
--- a/include/grpcpp/impl/codegen/time.h
+++ b/include/grpcpp/impl/codegen/time.h
@@ -19,6 +19,10 @@
 #ifndef GRPCPP_IMPL_CODEGEN_TIME_H
 #define GRPCPP_IMPL_CODEGEN_TIME_H
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 // IWYU pragma: private

 /// TODO(chengyuc): Remove this file after solving compatibility.
diff --git a/include/grpcpp/impl/server_builder_plugin.h b/include/grpcpp/impl/server_builder_plugin.h
index 39450b4..e0db479 100644
--- a/include/grpcpp/impl/server_builder_plugin.h
+++ b/
@@ -19,6 +19,10 @@
 #ifndef GRPCPP_IMPL_SERVER_BUILDER_PLUGIN_H
 #define GRPCPP_IMPL_SERVER_BUILDER_PLUGIN_H
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #include <memory>
 
 #include <grpcpp/support/channel_arguments.h>
diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h
index d8c9e04..eeecb6a 100644
--- a/include/grpcpp/security/credentials.h
+++ b/include/grpcpp/security/credentials.h
@@ -19,6 +19,10 @@
 #ifndef GRPCPP_SECURITY_CREDENTIALS_H
 #define GRPCPP_SECURITY_CREDENTIALS_H

+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #include <map>
 #include <memory>
 #include <vector>
diff --git a/include/grpcpp/server.h b/include/grpcpp/server.h
index 885bd8d..fedfe08 100644
--- a/include/grpcpp/server.h
+++ b/include/grpcpp/server.h
@@ -19,6 +19,10 @@
 #ifndef GRPCPP_SERVER_H
 #define GRPCPP_SERVER_H
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #include <grpc/support/port_platform.h>
 
 #include <list>
diff --git a/include/grpcpp/support/channel_arguments.h b/include/grpcpp/support/channel_arguments.h
index 217929d..01861c9 100644
--- a/include/grpcpp/support/channel_arguments.h
+++ b/include/grpcpp/support/channel_arguments.h
@@ -19,6 +19,10 @@
 #ifndef GRPCPP_SUPPORT_CHANNEL_ARGUMENTS_H
 #define GRPCPP_SUPPORT_CHANNEL_ARGUMENTS_H
 
+#if defined(__GNUC__)
+#pragma GCC system_header
+#endif
+
 #include <list>
 #include <vector>

diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index b004687..d30d830 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -108,6 +108,10 @@ grpc::string GetHeaderPrologue(grpc_generator::File* file,
     printer->Print(vars, "#ifndef GRPC_$filename_identifier$__INCLUDED\n");
     printer->Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n");
     printer->Print(vars, "\n");
+    printer->Print(vars, "#if defined(__GNUC__)\n");
+    printer->Print(vars, "#pragma GCC system_header\n");
+    printer->Print(vars, "#endif\n");
+    printer->Print(vars, "\n");
     printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n");
     printer->Print(vars, file->additional_headers().c_str());
     printer->Print(vars, "\n");