From 9eafe4139d6b2c0cabe3c77a903d6ae931a26975 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 24 Aug 2023 20:18:26 +0200 Subject: Fix build on some Vala compiler versions See https://gitlab.gnome.org/GNOME/vala/-/issues/1474 and https://gitlab.gnome.org/GNOME/vala/-/issues/1478 --- xmpp-vala/src/core/module_flag.vala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xmpp-vala/src/core') diff --git a/xmpp-vala/src/core/module_flag.vala b/xmpp-vala/src/core/module_flag.vala index 95547852..76ae4dc1 100644 --- a/xmpp-vala/src/core/module_flag.vala +++ b/xmpp-vala/src/core/module_flag.vala @@ -10,7 +10,12 @@ namespace Xmpp { } public T? cast(XmppStreamFlag flag) { +#if VALA_0_56_11 + // We can't typecheck due to compiler bug + return (T) module; +#else return flag.get_type().is_a(typeof(T)) ? (T?) flag : null; +#endif } public bool matches(XmppStreamFlag module) { @@ -34,7 +39,12 @@ namespace Xmpp { } public T? cast(XmppStreamModule module) { +#if VALA_0_56_11 + // We can't typecheck due to compiler bug + return (T) module; +#else return module.get_type().is_a(typeof(T)) ? (T?) module : null; +#endif } public bool matches(XmppStreamModule module) { -- cgit v1.2.3-70-g09d2