Backport a patch to support fixed-size array as return-value

https://bugzilla.redhat.com/show_bug.cgi?id=1398738
This commit is contained in:
Kalev Lember 2016-12-02 10:29:22 +01:00
parent f39ad1bd0b
commit c5e83e8971
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 7e76f75e42e7ac45c896e81e97955c8b2089d7e9 Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Thu, 24 Nov 2016 09:23:40 +0100
Subject: [PATCH] girparser: No support for fixed-size array as return-value
Due to the special syntax for those arrays it lead to omitting the
array-qualifier and therefore generating broken bindings.
---
vala/valagirparser.vala | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index d05d08a..b0ae2b0 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -2387,6 +2387,14 @@ public class Vala.GirParser : CodeVisitor {
type.nullable = true;
}
type = element_get_type (type, true, ref no_array_length, ref array_null_terminated);
+
+ // FIXME No support for fixed-size array as return-value
+ var array_type = type as ArrayType;
+ if (array_type != null && array_type.fixed_length) {
+ array_type.fixed_length = false;
+ array_type.length = null;
+ }
+
end_element ("return-value");
return type;
}
--
2.9.3

View File

@ -3,7 +3,7 @@
Name: vala
Version: 0.34.3
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A modern programming language for GNOME
# Most files are LGPLv2.1+, curses.vapi is 2-clause BSD
@ -12,6 +12,8 @@ URL: https://wiki.gnome.org/Projects/Vala
Source0: https://download.gnome.org/sources/vala/0.34/vala-%{version}.tar.xz
# https://bugzilla.gnome.org/show_bug.cgi?id=775446
Patch0: 0001-codegen-Add-function-prototypes-for-all-register-typ.patch
# Backported from upstream
Patch1: 0001-girparser-No-support-for-fixed-size-array-as-return-.patch
BuildRequires: flex
BuildRequires: bison
@ -89,6 +91,7 @@ This package contains documentation in a devhelp HTML book.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
@ -184,6 +187,9 @@ done
%changelog
* Fri Dec 02 2016 Kalev Lember <klember@redhat.com> - 0.34.3-3
- Backport a patch to support fixed-size array as return-value (#1398738)
* Thu Dec 01 2016 Kalev Lember <klember@redhat.com> - 0.34.3-2
- codegen: Add function-prototypes for all register-type calls