LibGfx: Spell IPCEncode::encode definitions instead of abusing concepts

The original approach failed to link with LLVM 18 because of the changed
symbol mangling.
This commit is contained in:
Daniel Bertalan 2024-04-13 01:21:20 -04:00 committed by Andrew Kaster
commit d282066ba4
Notes: sideshowbarker 2024-07-17 09:48:50 +09:00

View file

@ -51,16 +51,21 @@ ByteString FloatPoint::to_byte_string() const
namespace IPC {
template<OneOf<Gfx::IntPoint, Gfx::FloatPoint> Point>
ErrorOr<void> encode(Encoder& encoder, Point const& point)
template<>
ErrorOr<void> encode(Encoder& encoder, Gfx::IntPoint const& point)
{
TRY(encoder.encode(point.x()));
TRY(encoder.encode(point.y()));
return {};
}
template ErrorOr<void> encode(Encoder&, Gfx::IntPoint const& point);
template ErrorOr<void> encode(Encoder&, Gfx::FloatPoint const& point);
template<>
ErrorOr<void> encode(Encoder& encoder, Gfx::FloatPoint const& point)
{
TRY(encoder.encode(point.x()));
TRY(encoder.encode(point.y()));
return {};
}
template<>
ErrorOr<Gfx::IntPoint> decode(Decoder& decoder)