diff --git a/hpb/backend/upb/upb.h b/hpb/backend/upb/upb.h index 3e35f0dd2b..95ae7c2056 100644 --- a/hpb/backend/upb/upb.h +++ b/hpb/backend/upb/upb.h @@ -9,14 +9,13 @@ #define GOOGLE_PROTOBUF_HPB_BACKEND_UPB_UPB_H__ #include "google/protobuf/hpb/backend/upb/interop.h" -#include "google/protobuf/hpb/internal/internal.h" #include "google/protobuf/hpb/internal/template_help.h" #include "google/protobuf/hpb/ptr.h" namespace hpb::internal::backend::upb { template -void ClearMessage(hpb::internal::PtrOrRaw message) { +void ClearMessage(hpb::internal::PtrOrRawMutable message) { auto ptr = Ptr(message); auto minitable = hpb::interop::upb::GetMiniTable(ptr); upb_Message_Clear(hpb::interop::upb::GetMessage(ptr), minitable); diff --git a/hpb/hpb.h b/hpb/hpb.h index 0703a4c968..f3807a197f 100644 --- a/hpb/hpb.h +++ b/hpb/hpb.h @@ -79,7 +79,7 @@ void DeepCopy(const T* source_message, T* target_message) { } template -void ClearMessage(hpb::internal::PtrOrRaw message) { +void ClearMessage(hpb::internal::PtrOrRawMutable message) { backend::ClearMessage(message); } diff --git a/hpb/internal/template_help.h b/hpb/internal/template_help.h index a67c5f27f6..f6f8757692 100644 --- a/hpb/internal/template_help.h +++ b/hpb/internal/template_help.h @@ -33,6 +33,9 @@ using RemovePtrT = typename RemovePtr::type; template , typename = std::enable_if_t>> +using PtrOrRawMutable = T; + +template > using PtrOrRaw = T; template