mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
Userland: Properly define IPC::encode and IPC::decode specializations
In order to avoid the base encode/decode methods from being used (and failing a static assertion), we must be sure to declare/define the custom type implementations as template specializations. After this, LibIPC is no longer sensitive to include order.
This commit is contained in:
parent
b1ea418d14
commit
05f41382bb
25 changed files with 75 additions and 2 deletions
|
@ -170,6 +170,7 @@ ErrorOr<void> Decoder::decode([[maybe_unused]] File& file)
|
|||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> decode(Decoder& decoder, Core::AnonymousBuffer& buffer)
|
||||
{
|
||||
bool valid;
|
||||
|
@ -187,6 +188,7 @@ ErrorOr<void> decode(Decoder& decoder, Core::AnonymousBuffer& buffer)
|
|||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> decode(Decoder& decoder, Core::DateTime& datetime)
|
||||
{
|
||||
i64 timestamp;
|
||||
|
@ -195,6 +197,7 @@ ErrorOr<void> decode(Decoder& decoder, Core::DateTime& datetime)
|
|||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> decode(Decoder& decoder, Core::ProxyData& data)
|
||||
{
|
||||
UnderlyingType<decltype(data.type)> type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue