1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix compiler warnings when compiled against musl libc

musl libc is complaining when <sys/poll.h> is used instead of <poll.h>
so change this.

This issue was reported for OpenWrt/LEDE where musl libc is the standard
C library instead of e.g. glibc, see the following link for the original PR:
https://github.com/openwrt/packages/pull/4263

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>

--

v3: refined checks/fallback paths as suggested by @bukka

v2: rebased to resolve merge conflict in main/php_network.h

v1: initial PR
This commit is contained in:
Michael Heimpold
2017-04-18 00:22:34 +02:00
committed by Jakub Zelenka
parent a0b9554f94
commit d9dfac90bf
4 changed files with 14 additions and 5 deletions

View File

@@ -120,8 +120,12 @@ typedef int php_socket_t;
/* uncomment this to debug poll(2) emulation on systems that have poll(2) */
/* #define PHP_USE_POLL_2_EMULATION 1 */
#if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL)
# include <poll.h>
#if defined(HAVE_POLL)
# if defined(HAVE_POLL_H)
# include <poll.h>
# elif defined(HAVE_SYS_POLL_H)
# include <sys/poll.h>
# endif
typedef struct pollfd php_pollfd;
#else
typedef struct _php_pollfd {