From c0b338a8becb12a660e0e2ee7e73d6f7482d28b5 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 10 Feb 2025 12:04:27 +0800 Subject: [PATCH] Fix compilation on Haiku Nightly hrev58622 * configure.ac (BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER): Define if BObjectList ownership over its contents is specified as a template parameter. * src/haiku_support.cc (class EmacsFontSelectionDialog) [BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER]: Adjust accordingly. (cherry picked from commit 6e8bb757841d76e2df9757404dfafc5cb7777cb8) --- configure.ac | 11 +++++++++++ src/haiku_support.cc | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 4dd897967c7..3161c99a238 100644 --- a/configure.ac +++ b/configure.ac @@ -2953,6 +2953,17 @@ if test "${opsys}" = "haiku" && test "${with_be_app}" = "yes"; then [AC_MSG_ERROR([The Application Kit headers required for building with the Application Kit were not found or cannot be compiled. Either fix this, or re-configure with the option '--without-be-app'.])]) + AC_CACHE_CHECK([whether BObjectList accepts ownership as a template parameter], + [emacs_cv_bobjectlist_ownership_is_template_parameter], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + static BObjectList test;]], [])], + [emacs_cv_bobjectlist_ownership_is_template_parameter=yes], + [emacs_cv_bobjectlist_ownership_is_template_parameter=no])]) + AS_IF([test "x$emacs_cv_bobjectlist_ownership_is_template_parameter"], + [AC_DEFINE([BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER], [1], + [Define to 1 if BObjectList ownership is defined as a template parameter.])]) AC_LANG_POP([C++]) fi diff --git a/src/haiku_support.cc b/src/haiku_support.cc index d83b5c145d6..bfa2cb51456 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2862,8 +2862,13 @@ class EmacsFontSelectionDialog : public BWindow BScrollView font_family_scroller; BScrollView font_style_scroller; TripleLayoutView style_view; +#ifdef BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER + BObjectList all_families; + BObjectList all_styles; +#else /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ BObjectList all_families; BObjectList all_styles; +#endif /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ BButton cancel_button, ok_button; BTextControl size_entry; port_id comm_port; @@ -3126,8 +3131,13 @@ public: B_SUPPORTS_LAYOUT, false, true), style_view (&font_style_scroller, &antialias_checkbox, &preview_checkbox), +#ifdef BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER + all_families (20), + all_styles (20), +#else /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ all_families (20, true), all_styles (20, true), +#endif /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ cancel_button ("Cancel", "Cancel", new BMessage (B_CANCEL)), ok_button ("OK", "OK", new BMessage (B_OK)), -- 2.39.5