mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +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:
@@ -22,6 +22,7 @@ ShareableBitmap::ShareableBitmap(NonnullRefPtr<Bitmap> bitmap, Tag)
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
bool encode(Encoder& encoder, Gfx::ShareableBitmap const& shareable_bitmap)
|
||||
{
|
||||
encoder << shareable_bitmap.is_valid();
|
||||
@@ -39,6 +40,7 @@ bool encode(Encoder& encoder, Gfx::ShareableBitmap const& shareable_bitmap)
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> decode(Decoder& decoder, Gfx::ShareableBitmap& shareable_bitmap)
|
||||
{
|
||||
bool valid = false;
|
||||
|
||||
Reference in New Issue
Block a user