Fix [-Wundef] warning in PCNTL extension

This commit is contained in:
George Peter Banyard 2020-05-20 13:59:44 +02:00
parent d50b076fa3
commit 24de4274f3
4 changed files with 13 additions and 13 deletions

View File

@ -35,7 +35,7 @@
#include "php_signal.h"
#include "php_ticks.h"
#if HAVE_GETPRIORITY || HAVE_SETPRIORITY || HAVE_WAIT3
#if defined(HAVE_GETPRIORITY) || defined(HAVE_SETPRIORITY) || defined(HAVE_WAIT3)
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
@ -166,7 +166,7 @@ void php_register_signal_constants(INIT_FUNC_ARGS)
REGISTER_LONG_CONSTANT("SIGRTMAX", (zend_long) SIGRTMAX, CONST_CS | CONST_PERSISTENT);
#endif
#if HAVE_GETPRIORITY || HAVE_SETPRIORITY
#if defined(HAVE_GETPRIORITY) || defined(HAVE_SETPRIORITY)
REGISTER_LONG_CONSTANT("PRIO_PGRP", PRIO_PGRP, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PRIO_USER", PRIO_USER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PRIO_PROCESS", PRIO_PROCESS, CONST_CS | CONST_PERSISTENT);
@ -181,7 +181,7 @@ void php_register_signal_constants(INIT_FUNC_ARGS)
/* }}} */
/* {{{ si_code */
#if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
REGISTER_LONG_CONSTANT("SI_USER", SI_USER, CONST_CS | CONST_PERSISTENT);
#ifdef SI_NOINFO
REGISTER_LONG_CONSTANT("SI_NOINFO", SI_NOINFO, CONST_CS | CONST_PERSISTENT);
@ -314,7 +314,7 @@ void php_register_signal_constants(INIT_FUNC_ARGS)
#ifdef BUS_OBJERR
REGISTER_LONG_CONSTANT("BUS_OBJERR", BUS_OBJERR, CONST_CS | CONST_PERSISTENT);
#endif
#endif /* HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT */
#endif /* defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT) */
/* }}} */
/* unshare(/clone) constants */
@ -1058,7 +1058,7 @@ PHP_FUNCTION(pcntl_sigprocmask)
#endif
#ifdef HAVE_STRUCT_SIGINFO_T
# if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
# if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{{ */
{
zval *user_set, *user_signo, *user_siginfo = NULL;

View File

@ -23,7 +23,7 @@ function pcntl_sigprocmask(int $how, array $set, &$oldset = null): bool {}
#endif
#ifdef HAVE_STRUCT_SIGINFO_T
#if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
function pcntl_sigwaitinfo(array $set, &$info = []): int|false {}
function pcntl_sigtimedwait(array $set, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {}

View File

@ -37,14 +37,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_sigprocmask, 0, 2, _IS_BOO
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_sigwaitinfo, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, set, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, info, "[]")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_sigtimedwait, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, set, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, info, "[]")
@ -128,10 +128,10 @@ ZEND_FUNCTION(pcntl_signal_dispatch);
#if defined(HAVE_SIGPROCMASK)
ZEND_FUNCTION(pcntl_sigprocmask);
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_FUNCTION(pcntl_sigwaitinfo);
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_FUNCTION(pcntl_sigtimedwait);
#endif
ZEND_FUNCTION(pcntl_wifexited);
@ -169,10 +169,10 @@ static const zend_function_entry ext_functions[] = {
#if defined(HAVE_SIGPROCMASK)
ZEND_FE(pcntl_sigprocmask, arginfo_pcntl_sigprocmask)
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo)
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait)
#endif
ZEND_FE(pcntl_wifexited, arginfo_pcntl_wifexited)

View File

@ -55,7 +55,7 @@ PHP_FUNCTION(pcntl_strerror);
PHP_FUNCTION(pcntl_sigprocmask);
#endif
#ifdef HAVE_STRUCT_SIGINFO_T
# if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT
# if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
PHP_FUNCTION(pcntl_sigwaitinfo);
PHP_FUNCTION(pcntl_sigtimedwait);
# endif