]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gobject-2.0: Fix GWeakRef not having a copy function tintou/weakref
authorCorentin Noël <corentin.noel@collabora.com>
Wed, 2 Oct 2024 09:11:48 +0000 (11:11 +0200)
committerCorentin Noël <corentin.noel@collabora.com>
Wed, 2 Oct 2024 09:11:48 +0000 (11:11 +0200)
Add its private field to allow to actually generate a copy function.
Note that the generated copy function does not call g_weak_ref_init which
is required for a real copy.

vapi/gobject-2.0.vapi

index b3812febfd84ce1742b742f126e0a7691484095a..82060a5642599595776c05346aa7de211662608d 100644 (file)
@@ -858,12 +858,14 @@ namespace GLib {
                public static bool type_transformable (GLib.Type src_type, GLib.Type dest_type);
                public void unset ();
        }
-       [CCode (cheader_filename = "glib-object.h", destroy_function = "g_weak_ref_clear", has_type_id = false, lvalue_access = false)]
+       [CCode (cheader_filename = "glib-object.h", has_copy_function = false, destroy_function = "g_weak_ref_clear", has_type_id = false, lvalue_access = false)]
        [Version (since = "2.32")]
        public struct WeakRef {
                public WeakRef (GLib.Object? object);
                public GLib.Object? @get ();
                public void @set (GLib.Object? object);
+               [CCode (cname = "priv.p")]
+               private void* p;
        }
        [CCode (cheader_filename = "glib-object.h", cprefix = "G_BINDING_", type_id = "G_TYPE_BINDING_FLAGS")]
        [Flags]