1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00

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.
This commit is contained in:
Po Lu 2025-02-10 12:04:27 +08:00
parent ceef902594
commit 6e8bb75784
2 changed files with 21 additions and 0 deletions

View file

@ -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

View file

@ -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)),