From 8b15858c58a93133a08c729da92923b68eb94dec Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 23 Feb 2022 19:41:19 +0000 Subject: [PATCH] Fix GH-8142: Compilation error on cygwin * pcntl: SIGPOLL/si_band is unsupported * intl: enable the signal apis with `_POSIX_C_SOURCE` Closes GH-8146. --- NEWS | 6 ++++++ ext/intl/config.m4 | 3 +++ ext/pcntl/pcntl.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1ccffaae6c1..d1537408024 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,12 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2022, PHP 8.0.18 +- Intl: + . Fixed bug GH-8142 (Compilation error on cygwin). (David Carlier) + +- Pcntl: + . Fixed bug GH-8142 (Compilation error on cygwin). (David Carlier) + - Standard: . Fixed bug GH-8048 (Force macOS to use statfs). (risner) diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index b511f00451b..36221a9d7bf 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -85,6 +85,9 @@ if test "$PHP_INTL" != "no"; then PHP_REQUIRE_CXX() PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX) PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS" + case $host_alias in + *cygwin*) PHP_INTL_CXX_FLAGS="$PHP_INTL_CXX_FLAGS -D_POSIX_C_SOURCE=200809L" + esac if test "$ext_shared" = "no"; then PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS) else diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index e59decb3a55..2b1f9f5f1f0 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1160,7 +1160,7 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi case SIGBUS: add_assoc_double_ex(user_siginfo, "addr", sizeof("addr")-1, (zend_long)siginfo->si_addr); break; -#ifdef SIGPOLL +#if defined(SIGPOLL) && !defined(__CYGWIN__) case SIGPOLL: add_assoc_long_ex(user_siginfo, "band", sizeof("band")-1, siginfo->si_band); # ifdef si_fd