diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2023-04-22 10:49:14 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2023-04-22 10:50:10 +0200 |
commit | 1cd1a54adfa5883d7a6992a1643d47a3f430d317 (patch) | |
tree | e89c05bf3613ae926507d5a6d4bd3574516ab878 | |
parent | 4acd76cee98aa0a49b4d159e4986b24df8491f49 (diff) | |
download | vala-1cd1a54adfa5883d7a6992a1643d47a3f430d317.tar.gz |
codegen: Include "glib-object.h" when using GType/GBoxedCopyFunc
-rw-r--r-- | codegen/valaccodemethodmodule.vala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 6edafac6a..6365d3ad4 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -1036,6 +1036,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { } else if (m.parent_symbol is Class && m is CreationMethod) { var cl = (Class) m.parent_symbol; if (!cl.is_compact && vcall == null && (direction & 1) == 1) { + cfile.add_include ("glib-object.h"); cparam_map.set (get_param_pos (get_ccode_instance_pos (m)), new CCodeParameter ("object_type", "GType")); } } else if (m.binding == MemberBinding.INSTANCE && (direction != 2 || get_ccode_finish_instance (m))) { @@ -1079,6 +1080,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { if (type_parameters != null) { int type_param_index = 0; foreach (var type_param in type_parameters) { + cfile.add_include ("glib-object.h"); var type = get_ccode_type_id (type_param); var dup_func = get_ccode_copy_function (type_param); var destroy_func = get_ccode_destroy_function (type_param); |