summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Size.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-15 11:24:59 -0500
committerTim Flynn <trflynn89@pm.me>2022-11-15 13:25:51 -0500
commit05f41382bb527fbf2bb47340ad065b36f2e7409f (patch)
tree3da51238f398d92fc289351837cd26699bdad21f /Userland/Libraries/LibGfx/Size.cpp
parentb1ea418d14b4392741720914b834c61322cdb5b4 (diff)
downloadserenity-05f41382bb527fbf2bb47340ad065b36f2e7409f.zip
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.
Diffstat (limited to 'Userland/Libraries/LibGfx/Size.cpp')
-rw-r--r--Userland/Libraries/LibGfx/Size.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/Size.cpp b/Userland/Libraries/LibGfx/Size.cpp
index dc122d13bc..b5c70fe889 100644
--- a/Userland/Libraries/LibGfx/Size.cpp
+++ b/Userland/Libraries/LibGfx/Size.cpp
@@ -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;