From ebb9aa48aebf93700264224129bde5392f00bbe4 Mon Sep 17 00:00:00 2001 From: deepend Date: Mon, 16 Feb 2026 19:33:50 -0700 Subject: [PATCH] Added GTK2 compatibility macros in fe-gtk.h so calls to gtk_widget_set_hexpand() / gtk_widget_set_vexpand() become no-ops when !HAVE_GTK3, fixing the GTK2 implicit-declaration build failures introduced by GTK3-oriented layout code. Kept the macros warning-safe using (void) casts and G_STMT_START/G_STMT_END, so they compile cleanly in strict warning configurations. --- src/fe-gtk/fe-gtk.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fe-gtk/fe-gtk.h b/src/fe-gtk/fe-gtk.h index 81278662..03e55508 100644 --- a/src/fe-gtk/fe-gtk.h +++ b/src/fe-gtk/fe-gtk.h @@ -40,6 +40,14 @@ #endif #endif +#if !HAVE_GTK3 +/* GtkWidget expansion APIs were introduced in GTK3. Keep GTK2 builds + * source-compatible by accepting the calls as no-ops. + */ +#define gtk_widget_set_hexpand(widget, expand) G_STMT_START { (void) (widget); (void) (expand); } G_STMT_END +#define gtk_widget_set_vexpand(widget, expand) G_STMT_START { (void) (widget); (void) (expand); } G_STMT_END +#endif + #ifdef HAVE_GTK_MAC #include #endif