From 243a3be9185412a5a29ba189c77569fa96c85e89 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 20 Oct 2025 00:02:34 +0200 Subject: scintilla: use AX_PTRDIFF_ALIASES_INT to check whether ptrdiff_t aliases int * Scintilla had build problems if ptrdiff_t doesn't alias int if it has the same storage size (e.g. on NetBSD 10 (armv6)). * Unfortunately, Neil Hodgson refused to merge my previous Scintilla patches that would have fixed the issue at the core. See https://groups.google.com/g/scintilla-interest/c/STAv6LgLyCo * He only agreed to introducing a separate flag to work around the issue (`-DPTRDIFF_DOESNT_ALIAS_INT`). * In order to continue to support all standard C/C++ conforming platforms we therefore need a compile-time check to check for the aliasability of ptrdiff_t and int. --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9d5f74d..c0e9939 100644 --- a/configure.ac +++ b/configure.ac @@ -101,6 +101,13 @@ AC_PROG_CXX([c++ g++ clang++]) AX_CXX_COMPILE_STDCXX(17, noext, mandatory) AC_CHECK_TOOL(AR, ar) +# If ptrdiff_t does not alias int, we need a workaround +# in Scintilla. +AX_PTRDIFF_ALIASES_INT +if [[ "x$ax_cv_ptrdiff_aliases_int" = "xno" ]]; then + SCINTILLA_CXXFLAGS="$SCINTILLA_CXXFLAGS -DPTRDIFF_DOESNT_ALIAS_INT" +fi + # Whether $CC is Clang AM_CONDITIONAL(CLANG, [$CC --version | $GREP -i clang >/dev/null]) -- cgit v1.2.3