From: Michael Wallner Date: Wed, 23 Nov 2016 14:45:53 +0000 (+0000) Subject: fix ptrdiff_t and _GNU_SOURCE detection X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=commitdiff_plain;h=6864dd48391d1e98959ac13d5a0914693b4f1d0f;hp=6606de9915d219a59ad5d6cad531d8dd50946876 fix ptrdiff_t and _GNU_SOURCE detection --- diff --git a/config.m4 b/config.m4 index 98c0648..56635fa 100644 --- a/config.m4 +++ b/config.m4 @@ -48,7 +48,7 @@ PHP_ARG_ENABLE(psi, whether to enable PHP System Interface support, if test "$PHP_PSI" != no; then PHP_CONFIGURE_PART(Configuring PSI) - + PHP_ARG_ENABLE(psi-posix, whether to pre-define POSIX decls, [ --enable-psi-posix=... PSI: pre-define POSIX decls], [ ], [ ]) @@ -59,11 +59,11 @@ if test "$PHP_PSI" != no; then [ --with-psi-libffi=DIR PSI: path to libffi], [ ], [ ]) AC_HEADER_ASSERT dnl # adds --disable-assert to define NDEBUG - + dnl we cannot use AC_USE_SYSTEM_EXTENSIONS here, because we're way too late dnl in the game, and we're currently only targeting _GNU_SOURCE for now AC_MSG_CHECKING([for _GNU_SOURCE]) - AC_EGREP_CPP([gnu_source_defined], [ + AC_EGREP_CPP([gnu_source_not_defined], [ #ifndef _GNU_SOURCE gnu_source_not_defined #endif diff --git a/m4/posix/stddef.m4 b/m4/posix/stddef.m4 index fd52d2a..2c9abf2 100644 --- a/m4/posix/stddef.m4 +++ b/m4/posix/stddef.m4 @@ -1,5 +1,11 @@ PSI_CHECK_STDDEF() { + dnl Though, autoconf manual says "This macro is obsolescent, as current systems + dnl have conforming header files. New programs need not use this macro.", in fact + dnl AC_INCLUDES_DEFAULT still relies on STDC_HEADERS + AC_HEADER_STDC + AC_CHECK_HEADERS(stddef.h) + PSI_TYPE(ptrdiff_t, int) PSI_CONST(PTRDIFF_MIN, int) PSI_CONST(PTRDIFF_MAX, int) diff --git a/m4/psi/psi.m4 b/m4/psi/psi.m4 index 96c648e..4012ec1 100644 --- a/m4/psi/psi.m4 +++ b/m4/psi/psi.m4 @@ -191,7 +191,8 @@ AC_DEFUN(PSI_PTHREAD, [ dnl PSI_INCLUDES() dnl Expands to a complete list of include statements including dnl AC_INCLUDES_DEFAULT(). -AC_DEFUN(PSI_INCLUDES, [#define PSI_INCLUDES +AC_DEFUN(PSI_INCLUDES, [dnl +#define PSI_INCLUDES #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif