From 24de4274f31ede6b4f25b8c0e956bbca6464279e Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Wed, 20 May 2020 13:59:44 +0200 Subject: [PATCH] Fix [-Wundef] warning in PCNTL extension --- ext/pcntl/pcntl.c | 10 +++++----- ext/pcntl/pcntl.stub.php | 2 +- ext/pcntl/pcntl_arginfo.h | 12 ++++++------ ext/pcntl/php_pcntl.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index a52429e5497..6f9fd8a1820 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -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 #include #include @@ -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; diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 60e9c98a7fe..56532441191 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -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 {} diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index e7dff8e3794..3310785cc3a 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -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) diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index bbb07bc8961..4fec1627ad7 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -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