Skip to content

Commit

Permalink
Use G_DECLARE_FINAL_TYPE to fix build with flutter-snap (#211)
Browse files Browse the repository at this point in the history
The Clang version in core18-based flutter-snap is not happy with
`G_DEFINE_AUTOPTR_CLEANUP_FUNC`. Using `G_DECLARE_FINAL_TYPE` gives
autoptr support in a way that makes the old Clang happy.

Fixes: #210
  • Loading branch information
jpnurmi committed Sep 16, 2022
1 parent 2a503ab commit c1edf4b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions linux/include/yaru/yaru_plugin.h
Expand Up @@ -11,10 +11,7 @@ G_BEGIN_DECLS
#define FLUTTER_PLUGIN_EXPORT
#endif

typedef struct _YaruPlugin YaruPlugin;
typedef struct {
GObjectClass parent_class;
} YaruPluginClass;
G_DECLARE_FINAL_TYPE(YaruPlugin, yaru_plugin, YARU, PLUGIN, GObject)

FLUTTER_PLUGIN_EXPORT GType yaru_plugin_get_type();

Expand Down
5 changes: 0 additions & 5 deletions linux/yaru_plugin.cc
Expand Up @@ -3,11 +3,6 @@
#include <flutter_linux/flutter_linux.h>
#include <gtk/gtk.h>

#define YARU_PLUGIN(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), yaru_plugin_get_type(), YaruPlugin))

G_DEFINE_AUTOPTR_CLEANUP_FUNC(YaruPlugin, g_object_unref)

struct _YaruPlugin {
GObject parent_instance;
gint theme_name_changed_id;
Expand Down

0 comments on commit c1edf4b

Please sign in to comment.