[vala/wip/abi: 1/2] codegen: Add abi-stability path for classes
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/abi: 1/2] codegen: Add abi-stability path for classes
- Date: Thu, 18 Jan 2018 12:13:51 +0000 (UTC)
commit 843960739b324d01d71586f42136e1a452518a39
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Jan 18 09:32:09 2018 +0100
codegen: Add abi-stability path for classes
https://bugzilla.gnome.org/show_bug.cgi?id=789069
codegen/valagtypemodule.vala | 46 +++++++++++++++++++++++++++++++-----------
1 files changed, 34 insertions(+), 12 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index ea7dc3f..f5a7223 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -253,22 +253,44 @@ public class Vala.GTypeModule : GErrorModule {
}
bool has_struct_member = false;
- foreach (Method m in cl.get_methods ()) {
- generate_struct_method_declaration (cl, m, instance_struct, type_struct, decl_space,
ref has_struct_member);
- }
+ if (context.abi_stability) {
+ foreach (Symbol s in cl.get_members ()) {
+ if (s is Method) {
+ var m = (Method) s;
+ generate_struct_method_declaration (cl, m, instance_struct,
type_struct, decl_space, ref has_struct_member);
+ } else if (s is Signal) {
+ var sig = (Signal) s;
+ if (sig.default_handler != null) {
+ generate_virtual_method_declaration (sig.default_handler,
decl_space, type_struct);
+ }
+ } else if (s is Property) {
+ var prop = (Property) s;
+ generate_struct_property_declaration (cl, prop, instance_struct,
type_struct, decl_space, ref has_struct_member);
+ } else if (s is Field) {
+ var f = (Field) s;
+ generate_struct_field_declaration (cl, f, instance_struct,
type_struct, decl_space, ref has_struct_member);
+ } else {
+ assert_not_reached ();
+ }
+ }
+ } else {
+ foreach (Method m in cl.get_methods ()) {
+ generate_struct_method_declaration (cl, m, instance_struct, type_struct,
decl_space, ref has_struct_member);
+ }
- foreach (Signal sig in cl.get_signals ()) {
- if (sig.default_handler != null) {
- generate_virtual_method_declaration (sig.default_handler, decl_space,
type_struct);
+ foreach (Signal sig in cl.get_signals ()) {
+ if (sig.default_handler != null) {
+ generate_virtual_method_declaration (sig.default_handler, decl_space,
type_struct);
+ }
}
- }
- foreach (Property prop in cl.get_properties ()) {
- generate_struct_property_declaration (cl, prop, instance_struct, type_struct,
decl_space, ref has_struct_member);
- }
+ foreach (Property prop in cl.get_properties ()) {
+ generate_struct_property_declaration (cl, prop, instance_struct, type_struct,
decl_space, ref has_struct_member);
+ }
- foreach (Field f in cl.get_fields ()) {
- generate_struct_field_declaration (cl, f, instance_struct, type_struct, decl_space,
ref has_struct_member);
+ foreach (Field f in cl.get_fields ()) {
+ generate_struct_field_declaration (cl, f, instance_struct, type_struct,
decl_space, ref has_struct_member);
+ }
}
if (context.abi_stability) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]