From: Rico Tzschichholz Date: Fri, 11 Jan 2019 22:28:00 +0000 (+0100) Subject: codegen: Include "stddef.h" in CCodeBaseModule.destroy_value() (POSIX) X-Git-Tag: 0.43.5~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d4d498261b1662d9bfa9ba6e8a97b2236ff243e;p=thirdparty%2Fvala.git codegen: Include "stddef.h" in CCodeBaseModule.destroy_value() (POSIX) Fixes https://gitlab.gnome.org/GNOME/vala/issues/730 --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 070489be1..5e5b7e153 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -3472,6 +3472,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var cvar = get_cvalue_ (value); if (type is DelegateType) { + if (context.profile != Profile.GOBJECT) { + // Required for NULL + cfile.add_include ("stddef.h"); + } + var delegate_target = get_delegate_target_cvalue (value); var delegate_target_destroy_notify = get_delegate_target_destroy_notify_cvalue (value); @@ -3552,6 +3557,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { return ccall; } + if (context.profile != Profile.GOBJECT) { + // Required for NULL + cfile.add_include ("stddef.h"); + } + /* (foo == NULL ? NULL : foo = (unref (foo), NULL)) */ /* can be simplified to