From f8300e58d22f3c53b935298d421b7295808cad6f Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 26 Jun 2026 18:53:58 +0200 Subject: [PATCH] Sync #if/ifdef/defined (-Wundef) 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 --- Zend/zend_hrtime.h | 2 +- ext/pcntl/php_pcntl.h | 2 +- ext/standard/proc_open.c | 8 ++++---- main/main.c | 2 +- main/network.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Zend/zend_hrtime.h b/Zend/zend_hrtime.h index 464c7e571d5b..6d802caacfe0 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 17b86bca47d6..aaf1ea0ad473 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 bd7a2e58854f..29744018a16d 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 6bda55ac8746..afb9fd410e82 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 90d1716b5582..84a755505b21 100644 --- a/main/network.c +++ b/main/network.c @@ -44,7 +44,7 @@ #endif #ifdef HAVE_POLL_H #include -#elif HAVE_SYS_POLL_H +#elif defined(HAVE_SYS_POLL_H) #include #endif