03-sysheader.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. diff --git a/include/grpcpp/grpcpp.h b/include/grpcpp/grpcpp.h
  2. index aa8a242..39b7296 100644
  3. --- a/include/grpcpp/grpcpp.h
  4. +++ b/include/grpcpp/grpcpp.h
  5. @ -19,6 +19,11 @@
  6. #ifndef GRPCPP_SERVER_H
  7. #define GRPCPP_SERVER_H
  8. +#if defined(__GNUC__)
  9. +#pragma GCC system_header
  10. +#endif
  11. +
  12. +
  13. #include <list>
  14. #include <memory>
  15. #include <vector>
  16. diff --git a/include/grpcpp/impl/codegen/async_stream.h b/include/grpcpp/impl/codegen/async_stream.h
  17. index bfb2df4..4d66ec9 100644
  18. --- a/include/grpcpp/impl/codegen/async_stream.h
  19. +++ b/include/grpcpp/impl/codegen/async_stream.h
  20. @ -18,6 +18,10 @@
  21. #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
  22. #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
  23. +#if defined(__GNUC__)
  24. +#pragma GCC system_header
  25. +#endif
  26. +
  27. #include <grpcpp/impl/codegen/call.h>
  28. #include <grpcpp/impl/codegen/channel_interface.h>
  29. #include <grpcpp/impl/codegen/core_codegen_interface.h>
  30. diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h
  31. index 4ca87a9..7c03e09 100644
  32. --- a/include/grpcpp/impl/codegen/call_op_set.h
  33. +++ b/include/grpcpp/impl/codegen/call_op_set.h
  34. @@ -16,6 +16,10 @@
  35. //
  36. //
  37. +#if defined(__GNUC__)
  38. +#pragma GCC system_header
  39. +#endif
  40. +
  41. #ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
  42. #define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
  43. diff --git a/include/grpcpp/impl/codegen/callback_common.h b/include/grpcpp/impl/codegen/callback_common.h
  44. index a3c8c41..77f9c24 100644
  45. --- a/include/grpcpp/impl/codegen/callback_common.h
  46. +++ b/include/grpcpp/impl/codegen/callback_common.h
  47. @@ -16,6 +16,10 @@
  48. //
  49. //
  50. +#if defined(__GNUC__)
  51. +#pragma GCC system_header
  52. +#endif
  53. +
  54. #ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
  55. #define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
  56. diff --git a/include/grpcpp/impl/codegen/channel_interface.h b/include/grpcpp/impl/codegen/channel_interface.h
  57. index 5353f5f..03fbda0 100644
  58. --- a/include/grpcpp/impl/codegen/channel_interface.h
  59. +++ b/include/grpcpp/impl/codegen/channel_interface.h
  60. @@ -16,6 +16,10 @@
  61. //
  62. //
  63. +#if defined(__GNUC__)
  64. +#pragma GCC system_header
  65. +#endif
  66. +
  67. #ifndef GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
  68. #define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
  69. diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h
  70. index 8ed8423..0ca3fc7 100644
  71. --- a/include/grpcpp/impl/codegen/interceptor_common.h
  72. +++ b/include/grpcpp/impl/codegen/interceptor_common.h
  73. @@ -16,6 +16,10 @@
  74. //
  75. //
  76. +#if defined(__GNUC__)
  77. +#pragma GCC system_header
  78. +#endif
  79. +
  80. #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
  81. #define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
  82. diff --git a/include/grpcpp/impl/codegen/time.h b/include/grpcpp/impl/codegen/time.h
  83. index c32f254..46a4ccf 100644
  84. --- a/include/grpcpp/impl/codegen/time.h
  85. +++ b/include/grpcpp/impl/codegen/time.h
  86. @@ -19,6 +19,10 @@
  87. #ifndef GRPCPP_IMPL_CODEGEN_TIME_H
  88. #define GRPCPP_IMPL_CODEGEN_TIME_H
  89. +#if defined(__GNUC__)
  90. +#pragma GCC system_header
  91. +#endif
  92. +
  93. // IWYU pragma: private
  94. /// TODO(chengyuc): Remove this file after solving compatibility.
  95. diff --git a/include/grpcpp/impl/server_builder_plugin.h b/include/grpcpp/impl/server_builder_plugin.h
  96. index 39450b4..e0db479 100644
  97. --- a/include/grpcpp/impl/server_builder_plugin.h
  98. +++ b/
  99. @@ -19,6 +19,10 @@
  100. #ifndef GRPCPP_IMPL_SERVER_BUILDER_PLUGIN_H
  101. #define GRPCPP_IMPL_SERVER_BUILDER_PLUGIN_H
  102. +#if defined(__GNUC__)
  103. +#pragma GCC system_header
  104. +#endif
  105. +
  106. #include <memory>
  107. #include <grpcpp/support/channel_arguments.h>
  108. diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h
  109. index d8c9e04..eeecb6a 100644
  110. --- a/include/grpcpp/security/credentials.h
  111. +++ b/include/grpcpp/security/credentials.h
  112. @@ -19,6 +19,10 @@
  113. #ifndef GRPCPP_SECURITY_CREDENTIALS_H
  114. #define GRPCPP_SECURITY_CREDENTIALS_H
  115. +#if defined(__GNUC__)
  116. +#pragma GCC system_header
  117. +#endif
  118. +
  119. #include <map>
  120. #include <memory>
  121. #include <vector>
  122. diff --git a/include/grpcpp/server.h b/include/grpcpp/server.h
  123. index 885bd8d..fedfe08 100644
  124. --- a/include/grpcpp/server.h
  125. +++ b/include/grpcpp/server.h
  126. @@ -19,6 +19,10 @@
  127. #ifndef GRPCPP_SERVER_H
  128. #define GRPCPP_SERVER_H
  129. +#if defined(__GNUC__)
  130. +#pragma GCC system_header
  131. +#endif
  132. +
  133. #include <grpc/support/port_platform.h>
  134. #include <list>
  135. diff --git a/include/grpcpp/support/channel_arguments.h b/include/grpcpp/support/channel_arguments.h
  136. index 217929d..01861c9 100644
  137. --- a/include/grpcpp/support/channel_arguments.h
  138. +++ b/include/grpcpp/support/channel_arguments.h
  139. @@ -19,6 +19,10 @@
  140. #ifndef GRPCPP_SUPPORT_CHANNEL_ARGUMENTS_H
  141. #define GRPCPP_SUPPORT_CHANNEL_ARGUMENTS_H
  142. +#if defined(__GNUC__)
  143. +#pragma GCC system_header
  144. +#endif
  145. +
  146. #include <list>
  147. #include <vector>
  148. diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
  149. index b004687..d30d830 100644
  150. --- a/src/compiler/cpp_generator.cc
  151. +++ b/src/compiler/cpp_generator.cc
  152. @@ -108,6 +108,10 @@ grpc::string GetHeaderPrologue(grpc_generator::File* file,
  153. printer->Print(vars, "#ifndef GRPC_$filename_identifier$__INCLUDED\n");
  154. printer->Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n");
  155. printer->Print(vars, "\n");
  156. + printer->Print(vars, "#if defined(__GNUC__)\n");
  157. + printer->Print(vars, "#pragma GCC system_header\n");
  158. + printer->Print(vars, "#endif\n");
  159. + printer->Print(vars, "\n");
  160. printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n");
  161. printer->Print(vars, file->additional_headers().c_str());
  162. printer->Print(vars, "\n");