From 109c60b3bf8cd0ec0daf6e52ef181abe8801e3a3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 8 Sep 2024 19:02:44 +0100 Subject: [PATCH] Fix build failure on Debian bullseye from last commit. Jacob reports that bullseye objected to the change from G_APPLICATION_FLAGS_NONE to G_APPLICATION_DEFAULT_FLAGS, on the grounds that it only has the former defined. Sigh. Added a cmake check. --- cmake/cmake.h.in | 1 + cmake/gtk.cmake | 4 ++++ unix/gtkcompat.h | 4 ++++ unix/main-gtk-application.c | 1 + 4 files changed, 10 insertions(+) diff --git a/cmake/cmake.h.in b/cmake/cmake.h.in index 3882148b..f8fcbc58 100644 --- a/cmake/cmake.h.in +++ b/cmake/cmake.h.in @@ -48,6 +48,7 @@ #cmakedefine01 HAVE_BINARY_SETPGRP #cmakedefine01 HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE #cmakedefine01 HAVE_PANGO_FONT_MAP_LIST_FAMILIES +#cmakedefine01 HAVE_G_APPLICATION_DEFAULT_FLAGS #cmakedefine01 HAVE_AES_NI #cmakedefine01 HAVE_SHA_NI diff --git a/cmake/gtk.cmake b/cmake/gtk.cmake index 13ff7705..9c70c685 100644 --- a/cmake/gtk.cmake +++ b/cmake/gtk.cmake @@ -84,6 +84,10 @@ if(GTK_FOUND) ${HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE} PARENT_SCOPE) set(HAVE_PANGO_FONT_MAP_LIST_FAMILIES ${HAVE_PANGO_FONT_MAP_LIST_FAMILIES} PARENT_SCOPE) + check_c_source_compiles(" + #include + int f = G_APPLICATION_DEFAULT_FLAGS; + int main(void) {}" HAVE_G_APPLICATION_DEFAULT_FLAGS) endfunction() pango_check_subscope() endif() diff --git a/unix/gtkcompat.h b/unix/gtkcompat.h index 6ab5c809..2e8e8b88 100644 --- a/unix/gtkcompat.h +++ b/unix/gtkcompat.h @@ -218,3 +218,7 @@ gdk_cursor_new_for_display(gdk_display_get_default(), cur) #endif /* 3.0 */ + +#if !HAVE_G_APPLICATION_DEFAULT_FLAGS +#define G_APPLICATION_DEFAULT_FLAGS G_APPLICATION_FLAGS_NONE +#endif diff --git a/unix/main-gtk-application.c b/unix/main-gtk-application.c index 2bc1371a..3aaf6af7 100644 --- a/unix/main-gtk-application.c +++ b/unix/main-gtk-application.c @@ -79,6 +79,7 @@ https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling has some links. #include "putty.h" #include "gtkmisc.h" +#include "gtkcompat.h" char *x_get_default(const char *key) { return NULL; }