void-packages/srcpkgs/valabind/patches/vala-048.patch

45 lines
1.5 KiB
Diff

From 9d4fb181e24346a8c5d570290fa9892ce10c8c3b Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Thu, 6 Feb 2020 09:45:17 +0100
Subject: [PATCH] Fix build with Vala 0.48
---
gowriter.vala | 4 ++++
nodeffiwriter.vala | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/gowriter.vala b/gowriter.vala
index 56d9fbe..0fb09a6 100644
--- gowriter.vala
+++ gowriter.vala
@@ -214,7 +214,11 @@ public class GoNamer {
}
private string mangle_datatype(DataType d) {
+#if VALA_0_48
+ string ret = d.type_symbol.name; // i think should unify with get_type_declaration?
+#else
string ret = d.data_type.name; // i think should unify with get_type_declaration?
+#endif
if (d.get_type_arguments().size > 0) {
foreach(var dd in d.get_type_arguments()) {
ret += "_";
diff --git a/nodeffiwriter.vala b/nodeffiwriter.vala
index 84fede0..eba6329 100644
--- nodeffiwriter.vala
+++ nodeffiwriter.vala
@@ -85,8 +85,13 @@ public class NodeFFIWriter : ValabindWriter {
string _type = type.to_string ();
string local_ns_pfx = ns_pfx;
+#if VALA_0_48
+ if (type.type_symbol != null && type.type_symbol.parent_symbol is Namespace) {
+ Namespace local_ns = (Namespace)type.type_symbol.parent_symbol;
+#else
if (type.data_type != null && type.data_type.parent_symbol is Namespace) {
Namespace local_ns = (Namespace)type.data_type.parent_symbol;
+#endif
if (use_namespace(local_ns))
local_ns_pfx = local_ns.get_full_name()+".";
}