Commit dde19a5007a for php.net
commit dde19a5007a4a8bec69257f2891fa02746a19b9d
Author: Peter Kokot <peterkokot@gmail.com>
Date: Sun Jun 28 19:36:30 2026 +0200
Sync #if/ifdef/defined (-Wundef) (#22474)
The following macros are either defined (to 1) or undefined:
* HAVE_CLOCK_GETTIME_NSEC_NP
* HAVE_SYS_POLL_H
* HAVE_SYS_WAIT_H
* HAVE_TZSET
* HAVE_WIFCONTINUED
diff --git a/Zend/zend_hrtime.h b/Zend/zend_hrtime.h
index 464c7e571d5..6d802caacfe 100644
--- a/Zend/zend_hrtime.h
+++ b/Zend/zend_hrtime.h
@@ -42,7 +42,7 @@
#elif defined(_WIN32) || defined(_WIN64)
# undef ZEND_HRTIME_PLATFORM_WINDOWS
# define ZEND_HRTIME_PLATFORM_WINDOWS 1
-#elif HAVE_CLOCK_GETTIME_NSEC_NP
+#elif defined(HAVE_CLOCK_GETTIME_NSEC_NP)
# undef ZEND_HRTIME_PLATFORM_APPLE_GETTIME_NSEC
# define ZEND_HRTIME_PLATFORM_APPLE_GETTIME_NSEC 1
#elif defined(__APPLE__)
diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h
index 17b86bca47d..aaf1ea0ad47 100644
--- a/ext/pcntl/php_pcntl.h
+++ b/ext/pcntl/php_pcntl.h
@@ -17,7 +17,7 @@
#include "pcntl_decl.h"
-#if defined(HAVE_DECL_WCONTINUED) && HAVE_DECL_WCONTINUED == 1 && defined(HAVE_WIFCONTINUED) && HAVE_WIFCONTINUED == 1
+#if defined(HAVE_DECL_WCONTINUED) && HAVE_DECL_WCONTINUED == 1 && defined(HAVE_WIFCONTINUED)
#define HAVE_WCONTINUED 1
#endif
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index bd7a2e58854..29744018a16 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -266,7 +266,7 @@ static void proc_open_rsrc_dtor(zend_resource *rsrc)
php_process_handle *proc = (php_process_handle*)rsrc->ptr;
#ifdef PHP_WIN32
DWORD wstatus;
-#elif HAVE_SYS_WAIT_H
+#elif defined(HAVE_SYS_WAIT_H)
int wstatus;
int waitpid_options = 0;
pid_t wait_pid;
@@ -297,7 +297,7 @@ static void proc_open_rsrc_dtor(zend_resource *rsrc)
}
CloseHandle(proc->childHandle);
-#elif HAVE_SYS_WAIT_H
+#elif defined(HAVE_SYS_WAIT_H)
if (!FG(pclose_wait)) {
waitpid_options = WNOHANG;
}
@@ -389,7 +389,7 @@ PHP_FUNCTION(proc_get_status)
php_process_handle *proc;
#ifdef PHP_WIN32
DWORD wstatus;
-#elif HAVE_SYS_WAIT_H
+#elif defined(HAVE_SYS_WAIT_H)
int wstatus;
pid_t wait_pid;
#endif
@@ -418,7 +418,7 @@ PHP_FUNCTION(proc_get_status)
* even if the child has already exited. This is because the result stays available
* until the child handle is closed. Hence no caching is used on Windows. */
add_assoc_bool(return_value, "cached", false);
-#elif HAVE_SYS_WAIT_H
+#elif defined(HAVE_SYS_WAIT_H)
wait_pid = waitpid_cached(proc, &wstatus, WNOHANG|WUNTRACED);
if (wait_pid == proc->child) {
diff --git a/main/main.c b/main/main.c
index 6bda55ac874..afb9fd410e8 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2264,7 +2264,7 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi
zend_reset_lc_ctype_locale();
zend_update_current_locale();
-#if HAVE_TZSET
+#ifdef HAVE_TZSET
tzset();
#endif
diff --git a/main/network.c b/main/network.c
index 90d1716b558..84a755505b2 100644
--- a/main/network.c
+++ b/main/network.c
@@ -44,7 +44,7 @@
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
-#elif HAVE_SYS_POLL_H
+#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
#endif