NS: Use Cocoa implementation of EmacsBell -init if named image is declared

* configure.ac: Check for 'NSImageNameCaution' declaration when
building on GNUstep.
* src/nsterm.m ([EmacsBell init]): Use fallback implementation on
GNUstep only if 'NSImageNameCaution' is not declared.  (Bug#80107)
This commit is contained in:
Yavor Doganov 2026-01-01 18:26:38 +02:00 committed by Eli Zaretskii
parent ee65464ca1
commit 98f56a156e
2 changed files with 6 additions and 1 deletions

View file

@ -2886,6 +2886,11 @@ Mac OS X 12.x or later.
[Define to use native OS APIs for images.])
NATIVE_IMAGE_API="yes (ns)"
fi
if test "${NS_IMPL_GNUSTEP}" = yes; then
AC_CHECK_DECLS([NSImageNameCaution], [], [],
[[#import <AppKit/NSImage.h>]])
fi
fi
AC_SUBST([LIBS_GNUSTEP])

View file

@ -1221,7 +1221,7 @@ - (id)init
{
nestCount = 0;
isAttached = false;
#ifdef NS_IMPL_GNUSTEP
#if NS_IMPL_GNUSTEP && !HAVE_DECL_NSIMAGENAMECAUTION
// GNUstep doesn't provide named images. This was reported in
// 2011, see https://savannah.gnu.org/bugs/?33396
//