libostree: Remove compatibility code with GLib < 2.44
authorDaiki Ueno <dueno@redhat.com>
Wed, 10 Jul 2024 01:10:18 +0000 (10:10 +0900)
committerDaiki Ueno <dueno@redhat.com>
Wed, 10 Jul 2024 01:22:07 +0000 (10:22 +0900)
As the build system has required GLib 2.44 since commit
eb09207e1abd7499bd92866cce1de6148d659a4a, the manual expansion of
G_DECLARE_INTERFACE and G_DECLARE_FINAL_TYPE is no longer necessary.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
12 files changed:
src/libostree/ostree-autocleanups.h
src/libostree/ostree-repo-finder-avahi.h
src/libostree/ostree-repo-finder-config.h
src/libostree/ostree-repo-finder-mount.h
src/libostree/ostree-repo-finder-override.h
src/libostree/ostree-repo-finder.h
src/libostree/ostree-sign-dummy.c
src/libostree/ostree-sign-dummy.h
src/libostree/ostree-sign-ed25519.c
src/libostree/ostree-sign-ed25519.h
src/libostree/ostree-sign.h
tests/test-mock-gio.h

index d087e6aea3b85de5443caee39b943b4563e0bfab..75c4eecf07d13f8e235b1f7a2398965444ff4c1d 100644 (file)
@@ -64,15 +64,9 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (OstreeRepoCommitTraverseIter,
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeCollectionRef, ostree_collection_ref_free)
 G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeCollectionRefv, ostree_collection_ref_freev, NULL)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRemote, ostree_remote_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinder, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderAvahi, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderConfig, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderMount, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderOverride, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderResult, ostree_repo_finder_result_free)
 G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeRepoFinderResultv, ostree_repo_finder_result_freev, NULL)
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSign, g_object_unref)
 #endif
 
 G_END_DECLS
index 3885df6ee14c9c9bcab13a39122972449650ca2e..cb167623c32387cba5b9c836c561fb77f5820a1b 100644 (file)
@@ -33,33 +33,9 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_REPO_FINDER_AVAHI (ostree_repo_finder_avahi_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 _OSTREE_PUBLIC
 G_DECLARE_FINAL_TYPE (OstreeRepoFinderAvahi, ostree_repo_finder_avahi, OSTREE, REPO_FINDER_AVAHI,
-GObject) */
-
-_OSTREE_PUBLIC
-GType ostree_repo_finder_avahi_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeRepoFinderAvahi OstreeRepoFinderAvahi;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeRepoFinderAvahiClass;
-
-static inline OstreeRepoFinderAvahi *
-OSTREE_REPO_FINDER_AVAHI (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_repo_finder_avahi_get_type (),
-                                     OstreeRepoFinderAvahi);
-}
-static inline gboolean
-OSTREE_IS_REPO_FINDER_AVAHI (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_repo_finder_avahi_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
+                      GObject)
 
 _OSTREE_PUBLIC
 OstreeRepoFinderAvahi *ostree_repo_finder_avahi_new (GMainContext *context);
index 4570e5f4484098921b8f0110a51c67049bd0f561..13bf9e173981af281c71ce2ab007309a8b4f291a 100644 (file)
@@ -33,33 +33,9 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_REPO_FINDER_CONFIG (ostree_repo_finder_config_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 _OSTREE_PUBLIC
-G_DECLARE_FINAL_TYPE (OstreeRepoFinderConfig, ostree_repo_finder_config, OSTREE,
-REPO_FINDER_CONFIG, GObject) */
-
-_OSTREE_PUBLIC
-GType ostree_repo_finder_config_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeRepoFinderConfig OstreeRepoFinderConfig;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeRepoFinderConfigClass;
-
-static inline OstreeRepoFinderConfig *
-OSTREE_REPO_FINDER_CONFIG (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_repo_finder_config_get_type (),
-                                     OstreeRepoFinderConfig);
-}
-static inline gboolean
-OSTREE_IS_REPO_FINDER_CONFIG (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_repo_finder_config_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
+G_DECLARE_FINAL_TYPE (OstreeRepoFinderConfig, ostree_repo_finder_config, OSTREE, REPO_FINDER_CONFIG,
+                      GObject)
 
 _OSTREE_PUBLIC
 OstreeRepoFinderConfig *ostree_repo_finder_config_new (void);
index 1ba7851af617f0d04fb357c216133aa2963a36c0..532ba92fa1e557b20b57cd289fd1126c90c9d52b 100644 (file)
@@ -33,33 +33,9 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_REPO_FINDER_MOUNT (ostree_repo_finder_mount_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 _OSTREE_PUBLIC
 G_DECLARE_FINAL_TYPE (OstreeRepoFinderMount, ostree_repo_finder_mount, OSTREE, REPO_FINDER_MOUNT,
-GObject) */
-
-_OSTREE_PUBLIC
-GType ostree_repo_finder_mount_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeRepoFinderMount OstreeRepoFinderMount;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeRepoFinderMountClass;
-
-static inline OstreeRepoFinderMount *
-OSTREE_REPO_FINDER_MOUNT (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_repo_finder_mount_get_type (),
-                                     OstreeRepoFinderMount);
-}
-static inline gboolean
-OSTREE_IS_REPO_FINDER_MOUNT (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_repo_finder_mount_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
+                      GObject)
 
 _OSTREE_PUBLIC
 OstreeRepoFinderMount *ostree_repo_finder_mount_new (GVolumeMonitor *monitor);
index 978dc50891503a1e1028228eef59e0171f08cba0..6241500ee044a9b37714bc232fe2e9b92a1325d9 100644 (file)
@@ -33,33 +33,9 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_REPO_FINDER_OVERRIDE (ostree_repo_finder_override_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 _OSTREE_PUBLIC
 G_DECLARE_FINAL_TYPE (OstreeRepoFinderOverride, ostree_repo_finder_override, OSTREE,
-REPO_FINDER_OVERRIDE, GObject) */
-
-_OSTREE_PUBLIC
-GType ostree_repo_finder_override_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeRepoFinderOverride OstreeRepoFinderOverride;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeRepoFinderOverrideClass;
-
-static inline OstreeRepoFinderOverride *
-OSTREE_REPO_FINDER_OVERRIDE (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_repo_finder_override_get_type (),
-                                     OstreeRepoFinderOverride);
-}
-static inline gboolean
-OSTREE_IS_REPO_FINDER_OVERRIDE (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_repo_finder_override_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
+                      REPO_FINDER_OVERRIDE, GObject)
 
 _OSTREE_PUBLIC
 OstreeRepoFinderOverride *ostree_repo_finder_override_new (void);
index f587848099dbad56157ae58301ddc2a3eb9fb395..5c457720c5c2d20dacdd3fe135350f991c952a1d 100644 (file)
@@ -34,33 +34,8 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_REPO_FINDER (ostree_repo_finder_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 _OSTREE_PUBLIC
-G_DECLARE_INTERFACE (OstreeRepoFinder, ostree_repo_finder, OSTREE, REPO_FINDER, GObject) */
-
-_OSTREE_PUBLIC
-GType ostree_repo_finder_get_type (void);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeRepoFinder OstreeRepoFinder;
-typedef struct _OstreeRepoFinderInterface OstreeRepoFinderInterface;
-
-static inline OstreeRepoFinder *
-OSTREE_REPO_FINDER (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_repo_finder_get_type (), OstreeRepoFinder);
-}
-static inline gboolean
-OSTREE_IS_REPO_FINDER (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_repo_finder_get_type ());
-}
-static inline OstreeRepoFinderInterface *
-OSTREE_REPO_FINDER_GET_IFACE (gpointer ptr)
-{
-  return G_TYPE_INSTANCE_GET_INTERFACE (ptr, ostree_repo_finder_get_type (),
-                                        OstreeRepoFinderInterface);
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
+G_DECLARE_INTERFACE (OstreeRepoFinder, ostree_repo_finder, OSTREE, REPO_FINDER, GObject)
 
 struct _OstreeRepoFinderInterface
 {
index fdd6ca59bf6bf504885db3e23157ff8c6a608331..f5e837607a2d45c0739b7d62e0bc6b21b8ea61b7 100644 (file)
@@ -41,10 +41,6 @@ struct _OstreeSignDummy
   gchar *pk_ascii;
 };
 
-#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSignDummy, g_object_unref)
-#endif
-
 static void ostree_sign_dummy_iface_init (OstreeSignInterface *self);
 
 G_DEFINE_TYPE_WITH_CODE (OstreeSignDummy, _ostree_sign_dummy, G_TYPE_OBJECT,
index b13dbd186206dfc11f9d7fc70c5afb611633489f..e55627c223703519e95ff059b68969498c4acf4a 100644 (file)
@@ -30,36 +30,8 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_SIGN_DUMMY (_ostree_sign_dummy_get_type ())
 
-GType _ostree_sign_dummy_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeSignDummy OstreeSignDummy;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeSignDummyClass;
-
-static inline OstreeSignDummy *
-OSTREE_SIGN_DUMMY (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, _ostree_sign_dummy_get_type (), OstreeSignDummy);
-}
-static inline gboolean
-OSTREE_IS_SIGN_DUMMY (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, _ostree_sign_dummy_get_type ());
-}
-
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-/* Have to use glib-2.44 for this
 _OSTREE_PUBLIC
-G_DECLARE_FINAL_TYPE (OstreeSignDummy,
-                      ostree_sign_dummy,
-                      OSTREE,
-                      SIGN_DUMMY,
-                      GObject)
-*/
+G_DECLARE_FINAL_TYPE (OstreeSignDummy, _ostree_sign_dummy, OSTREE, SIGN_DUMMY, GObject)
 
 const gchar *ostree_sign_dummy_get_name (OstreeSign *self);
 
index cfe1f652fa7e85b806f7cddc055f52230179360b..3dcff2ebb58c27801ad2cf93c6c8805e5f2feca6 100644 (file)
@@ -53,10 +53,6 @@ struct _OstreeSignEd25519
   GList *revoked_keys; /* malloc'd buffer of length OSTREE_SIGN_ED25519_PUBKEY_SIZE */
 };
 
-#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSignEd25519, g_object_unref)
-#endif
-
 static void ostree_sign_ed25519_iface_init (OstreeSignInterface *self);
 
 G_DEFINE_TYPE_WITH_CODE (OstreeSignEd25519, _ostree_sign_ed25519, G_TYPE_OBJECT,
index e8c3df2a8012cf131bb13b4bf468f4ef83ccaff0..89d8b54d1e1018a2a372a9f581289542957bd66f 100644 (file)
@@ -30,36 +30,8 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_SIGN_ED25519 (_ostree_sign_ed25519_get_type ())
 
-GType _ostree_sign_ed25519_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeSignEd25519 OstreeSignEd25519;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeSignEd25519Class;
-
-static inline OstreeSignEd25519 *
-OSTREE_SIGN_ED25519 (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, _ostree_sign_ed25519_get_type (), OstreeSignEd25519);
-}
-static inline gboolean
-OSTREE_IS_SIGN_ED25519 (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, _ostree_sign_ed25519_get_type ());
-}
-
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-/* Have to use glib-2.44 for this
 _OSTREE_PUBLIC
-G_DECLARE_FINAL_TYPE (OstreeSignEd25519,
-                      ostree_sign_ed25519,
-                      OSTREE,
-                      SIGN_ED25519,
-                      GObject)
-*/
+G_DECLARE_FINAL_TYPE (OstreeSignEd25519, _ostree_sign_ed25519, OSTREE, SIGN_ED25519, GObject)
 
 gboolean ostree_sign_ed25519_data (OstreeSign *self, GBytes *data, GBytes **signature,
                                    GCancellable *cancellable, GError **error);
index ba84c5656759989150350c4e5b362bb8dc7523fb..9424b258f844efa39c31afdc0a54e8e673dfb575 100644 (file)
@@ -35,30 +35,6 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_SIGN (ostree_sign_get_type ())
 
-_OSTREE_PUBLIC
-GType ostree_sign_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeSign OstreeSign;
-typedef struct _OstreeSignInterface OstreeSignInterface;
-
-static inline OstreeSign *
-OSTREE_SIGN (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_sign_get_type (), OstreeSign);
-}
-static inline gboolean
-OSTREE_IS_SIGN (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_sign_get_type ());
-}
-static inline OstreeSignInterface *
-OSTREE_SIGN_GET_IFACE (gpointer ptr)
-{
-  return G_TYPE_INSTANCE_GET_INTERFACE (ptr, ostree_sign_get_type (), OstreeSignInterface);
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-
 /**
  * OSTREE_SIGN_NAME_ED25519:
  * The name of the default ed25519 signing type.
@@ -67,10 +43,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
  */
 #define OSTREE_SIGN_NAME_ED25519 "ed25519"
 
-/* Have to use glib-2.44 for this
 _OSTREE_PUBLIC
 G_DECLARE_INTERFACE (OstreeSign, ostree_sign, OSTREE, SIGN, GObject)
-*/
 
 struct _OstreeSignInterface
 {
index fae260ab98e388cb39ae85d264bbdad1d9a4cf66..784c7a9538bb2b2c4431abc69b7f98a1e623c769 100644 (file)
@@ -33,134 +33,33 @@ G_BEGIN_DECLS
 
 #define OSTREE_TYPE_MOCK_VOLUME_MONITOR (ostree_mock_volume_monitor_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 G_GNUC_INTERNAL
 G_DECLARE_FINAL_TYPE (OstreeMockVolumeMonitor, ostree_mock_volume_monitor, OSTREE,
-MOCK_VOLUME_MONITOR, GVolumeMonitor) */
-
-G_GNUC_INTERNAL
-GType ostree_mock_volume_monitor_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeMockVolumeMonitor OstreeMockVolumeMonitor;
-typedef struct
-{
-  GVolumeMonitorClass parent_class;
-} OstreeMockVolumeMonitorClass;
-
-static inline OstreeMockVolumeMonitor *
-OSTREE_MOCK_VOLUME_MONITOR (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_volume_monitor_get_type (),
-                                     OstreeMockVolumeMonitor);
-}
-static inline gboolean
-OSTREE_IS_MOCK_VOLUME_MONITOR (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_volume_monitor_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockVolumeMonitor, g_object_unref)
+                      MOCK_VOLUME_MONITOR, GVolumeMonitor)
 
 G_GNUC_INTERNAL
 GVolumeMonitor *ostree_mock_volume_monitor_new (GList *mounts, GList *volumes);
 
 #define OSTREE_TYPE_MOCK_VOLUME (ostree_mock_volume_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
-G_GNUC_INTERNAL
-G_DECLARE_FINAL_TYPE (OstreeMockVolume, ostree_mock_volume, OSTREE, MOCK_VOLUME, GObject) */
-
 G_GNUC_INTERNAL
-GType ostree_mock_volume_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeMockVolume OstreeMockVolume;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeMockVolumeClass;
-
-static inline OstreeMockVolume *
-OSTREE_MOCK_VOLUME (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_volume_get_type (), OstreeMockVolume);
-}
-static inline gboolean
-OSTREE_IS_MOCK_VOLUME (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_volume_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockVolume, g_object_unref)
+G_DECLARE_FINAL_TYPE (OstreeMockVolume, ostree_mock_volume, OSTREE, MOCK_VOLUME, GObject)
 
 G_GNUC_INTERNAL
 OstreeMockVolume *ostree_mock_volume_new (const gchar *name, GDrive *drive, GMount *mount);
 
 #define OSTREE_TYPE_MOCK_DRIVE (ostree_mock_drive_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
 G_GNUC_INTERNAL
-G_DECLARE_FINAL_TYPE (OstreeMockDrive, ostree_mock_drive, OSTREE, MOCK_DRIVE, GObject) */
-
-G_GNUC_INTERNAL
-GType ostree_mock_drive_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeMockDrive OstreeMockDrive;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeMockDriveClass;
-
-static inline OstreeMockDrive *
-OSTREE_MOCK_DRIVE (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_drive_get_type (), OstreeMockDrive);
-}
-static inline gboolean
-OSTREE_IS_MOCK_DRIVE (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_drive_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockDrive, g_object_unref)
+G_DECLARE_FINAL_TYPE (OstreeMockDrive, ostree_mock_drive, OSTREE, MOCK_DRIVE, GObject)
 
 G_GNUC_INTERNAL
 OstreeMockDrive *ostree_mock_drive_new (gboolean is_removable);
 
 #define OSTREE_TYPE_MOCK_MOUNT (ostree_mock_mount_get_type ())
 
-/* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44):
-G_GNUC_INTERNAL
-G_DECLARE_FINAL_TYPE (OstreeMockMount, ostree_mock_mount, OSTREE, MOCK_MOUNT, GObject) */
-
 G_GNUC_INTERNAL
-GType ostree_mock_mount_get_type (void);
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-typedef struct _OstreeMockMount OstreeMockMount;
-typedef struct
-{
-  GObjectClass parent_class;
-} OstreeMockMountClass;
-
-static inline OstreeMockMount *
-OSTREE_MOCK_MOUNT (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_mount_get_type (), OstreeMockMount);
-}
-static inline gboolean
-OSTREE_IS_MOCK_MOUNT (gpointer ptr)
-{
-  return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_mount_get_type ());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockMount, g_object_unref)
+G_DECLARE_FINAL_TYPE (OstreeMockMount, ostree_mock_mount, OSTREE, MOCK_MOUNT, GObject)
 
 G_GNUC_INTERNAL
 OstreeMockMount *ostree_mock_mount_new (const gchar *name, GFile *root);