diff --git a/include/grpc/byte_buffer_reader.h b/include/grpc/byte_buffer_reader.h index 763dd780d0d..93d7a72f1a3 100644 --- a/include/grpc/byte_buffer_reader.h +++ b/include/grpc/byte_buffer_reader.h @@ -21,6 +21,24 @@ #include -#include // IWYU pragma: export +#ifdef __cplusplus +extern "C" { +#endif + +struct grpc_byte_buffer; + +struct grpc_byte_buffer_reader { + struct grpc_byte_buffer* buffer_in; + struct grpc_byte_buffer* buffer_out; + /** Different current objects correspond to different types of byte buffers */ + union grpc_byte_buffer_reader_current { + /** Index into a slice buffer's array of slices */ + unsigned index; + } current; +}; + +#ifdef __cplusplus +} +#endif #endif /* GRPC_BYTE_BUFFER_READER_H */ diff --git a/include/grpc/impl/codegen/byte_buffer_reader.h b/include/grpc/impl/codegen/byte_buffer_reader.h index 35b8ee70c6a..8db815e42eb 100644 --- a/include/grpc/impl/codegen/byte_buffer_reader.h +++ b/include/grpc/impl/codegen/byte_buffer_reader.h @@ -19,26 +19,11 @@ #ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H #define GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H -// IWYU pragma: private, include +// IWYU pragma: private -#ifdef __cplusplus -extern "C" { -#endif +#include -struct grpc_byte_buffer; - -struct grpc_byte_buffer_reader { - struct grpc_byte_buffer* buffer_in; - struct grpc_byte_buffer* buffer_out; - /** Different current objects correspond to different types of byte buffers */ - union grpc_byte_buffer_reader_current { - /** Index into a slice buffer's array of slices */ - unsigned index; - } current; -}; - -#ifdef __cplusplus -} -#endif +/// TODO(chengyuc): Remove this file after solving compatibility. +#include #endif /* GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H */