From cb669029dbd56e1d60586b39161f4948250c2f56 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 13 Jul 2018 19:14:55 +0200 Subject: [PATCH] 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)))); -- 2.47.2