@@ -346,6 +346,20 @@ private static function init(): void
346346typedef int64_t gint64;
347347
348348typedef $ gtype GType;
349+
350+ typedef struct _GData GData;
351+
352+ typedef struct _GTypeClass GTypeClass;
353+
354+ typedef struct _GTypeInstance {
355+ GTypeClass *g_class;
356+ } GTypeInstance;
357+
358+ typedef struct _GObject {
359+ GTypeInstance g_type_instance;
360+ unsigned int ref_count;
361+ GData *qdata;
362+ } GObject;
349363EOS ;
350364
351365 // GLib declarations
@@ -361,14 +375,6 @@ private static function init(): void
361375 guint64 data[2];
362376} GValue;
363377
364- typedef struct _GData GData;
365-
366- typedef struct _GTypeClass GTypeClass;
367-
368- typedef struct _GTypeInstance {
369- GTypeClass *g_class;
370- } GTypeInstance;
371-
372378typedef struct _GParamSpec {
373379 GTypeInstance g_type_instance;
374380
@@ -386,12 +392,6 @@ private static function init(): void
386392 unsigned int param_id;
387393} GParamSpec;
388394
389- typedef struct _GObject {
390- GTypeInstance g_type_instance;
391- unsigned int ref_count;
392- GData *qdata;
393- } GObject;
394-
395395const char* g_type_name (GType gtype);
396396GType g_type_from_name (const char* name);
397397
@@ -478,8 +478,7 @@ private static function init(): void
478478typedef struct _VipsImage VipsImage;
479479typedef struct _VipsProgress VipsProgress;
480480
481- // Defined in GObject, just typedef to void*
482- typedef void* GObject;
481+ // Defined in GObject, just typedef to void
483482typedef void GParamSpec;
484483typedef void GValue;
485484
@@ -781,6 +780,9 @@ private static function init(): void
781780 self ::$ gobject = \FFI ::cdef ($ gobject_decls , $ gobject_libname );
782781 self ::$ vips = \FFI ::cdef ($ vips_decls , $ vips_libname );
783782
783+ # Useful for debugging
784+ # self::$vips->vips_leak_set(1);
785+
784786 # force the creation of some types we need
785787 self ::$ vips ->vips_blend_mode_get_type ();
786788 self ::$ vips ->vips_interpretation_get_type ();
0 commit comments