summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2025-02-10 12:04:27 +0800
committerPo Lu <luangruo@yahoo.com>2025-02-10 12:04:27 +0800
commit6e8bb757841d76e2df9757404dfafc5cb7777cb8 (patch)
treefbd6442d28019b62de9e522b618ce5054266ff7e
parentceef9025944fd3d51122f913ed9a74a259db55f7 (diff)
downloademacs-6e8bb757841d76e2df9757404dfafc5cb7777cb8.tar.gz
emacs-6e8bb757841d76e2df9757404dfafc5cb7777cb8.tar.bz2
emacs-6e8bb757841d76e2df9757404dfafc5cb7777cb8.zip
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.
-rw-r--r--configure.ac11
-rw-r--r--src/haiku_support.cc10
2 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 33d04a5bdb9..089a18959e3 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 <support/ObjectList.h>
+ #include <interface/StringItem.h>
+ static BObjectList<BStringItem, true> 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<BStringItem, true> all_families;
+ BObjectList<BStringItem, true> all_styles;
+#else /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */
BObjectList<BStringItem> all_families;
BObjectList<BStringItem> 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)),