[php-src] master: Sync #if/ifdef/defined (-Wundef) (#22474)

Peter Kokot via GitHub <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Peter Kokot (petk)
Committer: GitHub (web-flow)
Pusher: petk
Date: 2026-06-28T19:36:30+02:00

Commit: https://github.com/php/php-src/commit/dde19a5007a4a8bec69257f2891fa02746a19b9d
Raw diff: https://github.com/php/php-src/commit/dde19a5007a4a8bec69257f2891fa02746a19b9d.diff

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

Changed paths:
  M  Zend/zend_hrtime.h
  M  ext/pcntl/php_pcntl.h
  M  ext/standard/proc_open.c
  M  main/main.c
  M  main/network.c


Diff:

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 <poll.h>
-#elif HAVE_SYS_POLL_H
+#elif defined(HAVE_SYS_POLL_H)
 #include <sys/poll.h>
 #endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.