[vala] codegen: Don't emit g_type_add_instance_private() in *_register_type()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Don't emit g_type_add_instance_private() in *_register_type()
- Date: Fri, 13 Jul 2018 17:20:53 +0000 (UTC)
commit cb669029dbd56e1d60586b39161f4948250c2f56
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Fri Jul 13 19:14:55 2018 +0200
codegen: Don't emit g_type_add_instance_private() in *_register_type()
This fixes warnings like "sys:1: Warning: cannot add private field to
invalid (non-instantiatable) type ..."
Regression of df56f916e52e5efe3876afed59a6190f6cead1c8
codegen/valatyperegisterfunction.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala
index c1811d949..750537500 100644
--- a/codegen/valatyperegisterfunction.vala
+++ b/codegen/valatyperegisterfunction.vala
@@ -213,7 +213,7 @@ public abstract class Vala.TypeRegisterFunction {
type_init.add_statement (new CCodeExpressionStatement (add_class_private_call));
}
- if (cl != null && (cl.has_private_fields || cl.get_type_parameters ().size > 0)) {
+ if (!plugin && cl != null && (cl.has_private_fields || cl.get_type_parameters ().size > 0)) {
var ccall = new CCodeFunctionCall (new CCodeIdentifier
("g_type_add_instance_private"));
ccall.add_argument (new CCodeIdentifier (type_id_name));
ccall.add_argument (new CCodeIdentifier ("sizeof (%sPrivate)".printf (get_ccode_name
(cl))));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]