mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +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
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/trflynn89
Commit: 05f41382bb
Pull-request: https://github.com/SerenityOS/serenity/pull/16081
Issue: https://github.com/SerenityOS/serenity/issues/9584
Reviewed-by: https://github.com/linusg ✅
25 changed files with 75 additions and 2 deletions
|
@ -27,12 +27,14 @@ String FloatSize::to_string() const
|
|||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
bool encode(Encoder& encoder, Gfx::IntSize const& size)
|
||||
{
|
||||
encoder << size.width() << size.height();
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> decode(Decoder& decoder, Gfx::IntSize& size)
|
||||
{
|
||||
int width = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue