Fix GH-7978: sockets extension compilation errors

We fix the `ucred` detection when custom `CFLAGS` are in use.

Closes GH-7981.
This commit is contained in:
David Carlier 2022-01-21 13:39:30 +00:00 committed by Christoph M. Becker
parent 82b883034c
commit 07aaa34cd4
No known key found for this signature in database
GPG Key ID: D66C9593118BCCB6
2 changed files with 4 additions and 0 deletions

1
NEWS
View File

@ -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).

View File

@ -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 <sys/socket.h>
]], [[struct ucred u = {.gid = 0};]])],
[ac_cv_ucred=yes], [ac_cv_ucred=no])