]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Include "stddef.h" in CCodeBaseModule.destroy_value() (POSIX) 0d4d498261b1662d9bfa9ba6e8a97b2236ff243e
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 11 Jan 2019 22:28:00 +0000 (23:28 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 11 Jan 2019 22:33:02 +0000 (23:33 +0100)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/730

codegen/valaccodebasemodule.vala

index 070489be18b85e1cb2f6dea6d6624c34a3a89607..5e5b7e15300b5db788d637f71323ae99c58396b7 100644 (file)
@@ -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