[vala/0.54] codegen: Generated SimpleType structs don't have a type id
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.54] codegen: Generated SimpleType structs don't have a type id
- Date: Wed, 9 Feb 2022 13:02:36 +0000 (UTC)
commit c2da6437f71dc6a3932dc62eb33de62394621e89
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Jan 9 19:49:27 2022 +0100
codegen: Generated SimpleType structs don't have a type id
Set "CCode.has_type_id" in CCodeStructModule.generate_struct_declaration()
like in GTypeModule.visit_struct() for SimpleType structs which might be
executed too late.
In addition to 2e798fc3f8e9af25a4c231c2561894d9f0a0be50
codegen/valaccodestructmodule.vala | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/codegen/valaccodestructmodule.vala b/codegen/valaccodestructmodule.vala
index d9577e7df..9c1e71310 100644
--- a/codegen/valaccodestructmodule.vala
+++ b/codegen/valaccodestructmodule.vala
@@ -32,6 +32,11 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
if (st.base_struct != null) {
generate_struct_declaration (st.base_struct, decl_space);
+ } else if (!st.external_package) {
+ // custom simple type structs cannot have a type id which depends on head-allocation
+ if (st.get_attribute ("SimpleType") != null && !st.has_attribute_argument ("CCode",
"type_id")) {
+ st.set_attribute_bool ("CCode", "has_type_id", false);
+ }
}
if (st.is_boolean_type () || st.is_integer_type () || st.is_floating_type ()) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]