From 07aaa34cd418c44f7bc653fafbf49f07fc71b2bf Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 21 Jan 2022 13:39:30 +0000 Subject: [PATCH] Fix GH-7978: sockets extension compilation errors We fix the `ucred` detection when custom `CFLAGS` are in use. Closes GH-7981. --- NEWS | 1 + ext/sockets/config.m4 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 285d6265ee9..d32c3fb2f11 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,7 @@ PHP NEWS - Sockets: . Fixed ext/sockets build on Haiku. (David Carlier) + . Fixed bug GH-7978 (sockets extension compilation errors). (David Carlier) - Standard: . Fixed bug GH-7875 (mails are sent even if failure to log throws exception). diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4 index d4f92082c3b..aafedcb99dd 100644 --- a/ext/sockets/config.m4 +++ b/ext/sockets/config.m4 @@ -67,6 +67,9 @@ if test "$PHP_SOCKETS" != "no"; then AC_CACHE_CHECK([if ancillary credentials uses ucred],[ac_cv_ucred], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include ]], [[struct ucred u = {.gid = 0};]])], [ac_cv_ucred=yes], [ac_cv_ucred=no])