Apply upstream patch to fix C99 issue in generated code (#2179136)
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
bea00c525e
commit
f57c172232
66
vala-register_plugin_type-c99.patch
Normal file
66
vala-register_plugin_type-c99.patch
Normal file
@ -0,0 +1,66 @@
|
||||
commit a902d7eae96a3f1ab0cb64f268443b23ee8ab45a
|
||||
Author: Rico Tzschichholz <ricotz@ubuntu.com>
|
||||
Date: Sat Mar 18 12:40:55 2023 +0100
|
||||
|
||||
codegen: Add declaration for register call of dynamic DBus interfaces
|
||||
|
||||
The call was added without the required extern declaration
|
||||
|
||||
Found by -Werror=implicit-function-declaration
|
||||
|
||||
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1422
|
||||
|
||||
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
|
||||
index 77ff73c3120bcafd..6edafac6a07e7cb4 100644
|
||||
--- a/codegen/valaccodemethodmodule.vala
|
||||
+++ b/codegen/valaccodemethodmodule.vala
|
||||
@@ -291,6 +291,12 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
|
||||
}
|
||||
}
|
||||
|
||||
+ unowned Interface? iface = type_symbol as Interface;
|
||||
+ bool is_dbus_interface = false;
|
||||
+ if (iface != null) {
|
||||
+ is_dbus_interface = GDBusModule.get_dbus_name (type_symbol) != null;
|
||||
+ }
|
||||
+
|
||||
// Add function prototypes for required register-type-calls which are likely external
|
||||
if (type_symbol.source_reference.file != cfile.file) {
|
||||
// TODO Duplicated source with TypeRegisterFunction.init_from_type()
|
||||
@@ -298,22 +304,26 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
|
||||
register_func.add_parameter (new CCodeParameter ("module", "GTypeModule *"));
|
||||
register_func.is_declaration = true;
|
||||
cfile.add_function_declaration (register_func);
|
||||
+
|
||||
+ // TODO Duplicated source with GDBusClientModule.generate_interface_declaration()
|
||||
+ if (is_dbus_interface) {
|
||||
+ var proxy_register_type = new CCodeFunction ("%sproxy_register_dynamic_type".printf (get_ccode_lower_case_prefix (iface)));
|
||||
+ proxy_register_type.add_parameter (new CCodeParameter ("module", "GTypeModule*"));
|
||||
+ proxy_register_type.modifiers |= CCodeModifiers.EXTERN;
|
||||
+ cfile.add_function_declaration (proxy_register_type);
|
||||
+ requires_vala_extern = true;
|
||||
+ }
|
||||
}
|
||||
|
||||
var register_call = new CCodeFunctionCall (new CCodeIdentifier ("%s_register_type".printf (get_ccode_lower_case_name (type_symbol, null))));
|
||||
register_call.add_argument (new CCodeIdentifier (module_init_param_name));
|
||||
ccode.add_expression (register_call);
|
||||
|
||||
- var iface = type_symbol as Interface;
|
||||
- if (iface != null) {
|
||||
- string? dbus_name = GDBusModule.get_dbus_name(type_symbol);
|
||||
-
|
||||
- if (dbus_name != null) {
|
||||
- string proxy_cname = get_ccode_lower_case_prefix (type_symbol) + "proxy";
|
||||
- var register_proxy = new CCodeFunctionCall (new CCodeIdentifier ("%s_register_dynamic_type".printf (proxy_cname)));
|
||||
- register_proxy.add_argument (new CCodeIdentifier (module_init_param_name));
|
||||
- ccode.add_expression (register_proxy);
|
||||
- }
|
||||
+ if (is_dbus_interface) {
|
||||
+ string proxy_cname = get_ccode_lower_case_prefix (type_symbol) + "proxy";
|
||||
+ var register_proxy = new CCodeFunctionCall (new CCodeIdentifier ("%s_register_dynamic_type".printf (proxy_cname)));
|
||||
+ register_proxy.add_argument (new CCodeIdentifier (module_init_param_name));
|
||||
+ ccode.add_expression (register_proxy);
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,14 @@
|
||||
|
||||
Name: vala
|
||||
Version: 0.56.4
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: A modern programming language for GNOME
|
||||
|
||||
# Most files are LGPLv2.1+, curses.vapi is 2-clause BSD
|
||||
License: LGPL-2.1-or-later AND BSD-2-Clause
|
||||
URL: https://wiki.gnome.org/Projects/Vala
|
||||
Source0: https://download.gnome.org/sources/%{name}/0.56/%{name}-%{version}.tar.xz
|
||||
Patch0: vala-register_plugin_type-c99.patch
|
||||
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
@ -19,7 +20,7 @@ BuildRequires: libxslt
|
||||
BuildRequires: make
|
||||
BuildRequires: pkgconfig(gobject-2.0)
|
||||
# only if Vala source files are patched
|
||||
#BuildRequires: vala
|
||||
BuildRequires: vala
|
||||
|
||||
# for tests
|
||||
BuildRequires: dbus-x11
|
||||
@ -194,6 +195,9 @@ export -n VALAFLAGS
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Mar 20 2023 Florian Weimer <fweimer@redhat.com> - 0.56.4-2
|
||||
- Apply upstream patch to fix C99 issue in generated code (#2179136)
|
||||
|
||||
* Thu Mar 09 2023 David King <amigadave@amigadave.com> - 0.56.4-1
|
||||
- Update to 0.56.4
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user