From f7b5553045e2903852f0a9a90b382d1617ff18a0 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 22 Feb 2022 18:46:12 +0800 Subject: [PATCH] Fix GTK build with GLib <2.44 * src/gtkutil.c (struct _EmacsMenuBar, EmacsMenuBar): New structs. (emacs_menu_bar_get_type): New function declaration. * src/gtkutil.c: Remove declaration of EmacsMenuBar class. --- src/gtkutil.c | 10 ++++++++-- src/gtkutil.h | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gtkutil.c b/src/gtkutil.c index 72eb7ef2bb1..d4726014c01 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -78,11 +78,17 @@ typedef struct pgtk_output xp_output; #ifdef HAVE_GTK3 static void emacs_menu_bar_get_preferred_width (GtkWidget *, gint *, gint *); +static GType emacs_menu_bar_get_type (void); -struct _EmacsMenuBar +typedef struct _EmacsMenuBar { GtkMenuBar parent; -}; +} EmacsMenuBar; + +typedef struct _EmacsMenuBarClass +{ + GtkMenuBarClass parent; +} EmacsMenuBarClass; G_DEFINE_TYPE (EmacsMenuBar, emacs_menu_bar, GTK_TYPE_MENU_BAR) #endif diff --git a/src/gtkutil.h b/src/gtkutil.h index f850ecc4219..b74244d84d0 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -83,10 +83,6 @@ typedef struct xg_menu_item_cb_data_ } xg_menu_item_cb_data; -#ifdef HAVE_GTK3 -G_DECLARE_FINAL_TYPE (EmacsMenuBar, emacs_menu_bar, EMACS, MENU_BAR, GtkMenuBar) -#endif - extern bool xg_uses_old_file_dialog (void); extern char *xg_get_file_name (struct frame *f, -- 2.39.5