diff options
| -rw-r--r-- | configure.ac | 7 | ||||
| m--------- | contrib/scintilla | 0 | ||||
| -rw-r--r-- | m4/ax_ptrdiff_aliases_int.m4 | 16 |
3 files changed, 23 insertions, 0 deletions
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]) diff --git a/contrib/scintilla b/contrib/scintilla -Subproject 7c7d68414f408e83c0b17088d92212fc10883ea +Subproject 333dd3153850d05a219731dee0b899155442b19 diff --git a/m4/ax_ptrdiff_aliases_int.m4 b/m4/ax_ptrdiff_aliases_int.m4 new file mode 100644 index 0000000..f7175cd --- /dev/null +++ b/m4/ax_ptrdiff_aliases_int.m4 @@ -0,0 +1,16 @@ + +AC_DEFUN([AX_PTRDIFF_ALIASES_INT], [ + AC_CACHE_CHECK([whether ptrdiff_t aliases int], [ax_cv_ptrdiff_aliases_int], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include <stddef.h> + ]], [[ + int a = 23; + ptrdiff_t *b = &a; + ]])], + [ax_cv_ptrdiff_aliases_int=yes], + [ax_cv_ptrdiff_aliases_int=no]) + ]) + AS_IF([test "x$ax_cv_ptrdiff_aliases_int" = "xyes"], [ + AC_DEFINE([PTRDIFF_ALIASES_INT], [1], [Whether ptrdiff_t aliases int]) + ]) +])dnl |
