mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -196,6 +196,7 @@ Encoder& Encoder::operator<<(File const& file)
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool encode(Encoder& encoder, Core::AnonymousBuffer const& buffer)
|
||||
{
|
||||
encoder << buffer.is_valid();
|
||||
@@ -206,12 +207,14 @@ bool encode(Encoder& encoder, Core::AnonymousBuffer const& buffer)
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool encode(Encoder& encoder, Core::DateTime const& datetime)
|
||||
{
|
||||
encoder << static_cast<i64>(datetime.timestamp());
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool encode(Encoder& encoder, Core::ProxyData const& proxy)
|
||||
{
|
||||
encoder << to_underlying(proxy.type);
|
||||
|
||||
Reference in New Issue
Block a user