aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2023-08-24 20:18:26 +0200
committerfiaxh <git@lightrise.org>2023-09-24 19:51:33 +0200
commit9eafe4139d6b2c0cabe3c77a903d6ae931a26975 (patch)
tree7a1fa0a2a5fc25b9b8dfe2688a9f622fbd742d70 /libdino
parent2fba24ccae13e832bd38ff9c7fea71c1a802603d (diff)
downloaddino-9eafe4139d6b2c0cabe3c77a903d6ae931a26975.tar.gz
dino-9eafe4139d6b2c0cabe3c77a903d6ae931a26975.zip
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
Diffstat (limited to 'libdino')
-rw-r--r--libdino/CMakeLists.txt7
-rw-r--r--libdino/src/service/stream_interactor.vala5
2 files changed, 12 insertions, 0 deletions
diff --git a/libdino/CMakeLists.txt b/libdino/CMakeLists.txt
index 3c184cfd..fc283417 100644
--- a/libdino/CMakeLists.txt
+++ b/libdino/CMakeLists.txt
@@ -6,6 +6,11 @@ find_packages(LIBDINO_PACKAGES REQUIRED
GObject
)
+set(LIBDINO_DEFINITIONS)
+if(LIBDINO_VERSION VERSION_EQUAL "0.56.11")
+ set(LIBDINO_DEFINITIONS ${LIBDINO_DEFINITIONS} VALA_0_56_11)
+endif()
+
vala_precompile(LIBDINO_VALA_C
SOURCES
src/application.vala
@@ -76,6 +81,8 @@ GENERATE_VAPI
dino
GENERATE_HEADER
dino
+DEFINITIONS
+ ${LIBDINO_DEFINITIONS}
)
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/dino_i18n.h"
diff --git a/libdino/src/service/stream_interactor.vala b/libdino/src/service/stream_interactor.vala
index 192460d4..5d248327 100644
--- a/libdino/src/service/stream_interactor.vala
+++ b/libdino/src/service/stream_interactor.vala
@@ -89,7 +89,12 @@ public class ModuleIdentity<T> : Object {
}
public T? cast(StreamInteractionModule 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(StreamInteractionModule module) {