From: George Peter Banyard Date: Tue, 12 May 2020 15:53:41 +0000 (+0200) Subject: Fix [-Wundef] warning in FPM SAPI X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f87743de9fc07084b8fec6e3a0a8f628ee6fa372;p=php Fix [-Wundef] warning in FPM SAPI --- diff --git a/sapi/fpm/fpm/events/devpoll.c b/sapi/fpm/fpm/events/devpoll.c index 15afb2beda..0d165fe2fc 100644 --- a/sapi/fpm/fpm/events/devpoll.c +++ b/sapi/fpm/fpm/events/devpoll.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#if HAVE_DEVPOLL +#ifdef HAVE_DEVPOLL #include #include @@ -53,7 +53,7 @@ static int npollfds = 0; struct fpm_event_module_s *fpm_event_devpoll_module() /* {{{ */ { -#if HAVE_DEVPOLL +#ifdef HAVE_DEVPOLL return &devpoll_module; #else return NULL; @@ -61,7 +61,7 @@ struct fpm_event_module_s *fpm_event_devpoll_module() /* {{{ */ } /* }}} */ -#if HAVE_DEVPOLL +#ifdef HAVE_DEVPOLL /* * Init module diff --git a/sapi/fpm/fpm/events/epoll.c b/sapi/fpm/fpm/events/epoll.c index b81c7fa59c..9973ac0ddc 100644 --- a/sapi/fpm/fpm/events/epoll.c +++ b/sapi/fpm/fpm/events/epoll.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#if HAVE_EPOLL +#ifdef HAVE_EPOLL #include #include @@ -48,7 +48,7 @@ static int epollfd = -1; struct fpm_event_module_s *fpm_event_epoll_module() /* {{{ */ { -#if HAVE_EPOLL +#ifdef HAVE_EPOLL return &epoll_module; #else return NULL; @@ -56,7 +56,7 @@ struct fpm_event_module_s *fpm_event_epoll_module() /* {{{ */ } /* }}} */ -#if HAVE_EPOLL +#ifdef HAVE_EPOLL /* * Init the module diff --git a/sapi/fpm/fpm/events/kqueue.c b/sapi/fpm/fpm/events/kqueue.c index 42d70ecd6c..69a3f24057 100644 --- a/sapi/fpm/fpm/events/kqueue.c +++ b/sapi/fpm/fpm/events/kqueue.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#if HAVE_KQUEUE +#ifdef HAVE_KQUEUE #include #include @@ -54,7 +54,7 @@ static int kfd = 0; */ struct fpm_event_module_s *fpm_event_kqueue_module() /* {{{ */ { -#if HAVE_KQUEUE +#ifdef HAVE_KQUEUE return &kqueue_module; #else return NULL; @@ -62,7 +62,7 @@ struct fpm_event_module_s *fpm_event_kqueue_module() /* {{{ */ } /* }}} */ -#if HAVE_KQUEUE +#ifdef HAVE_KQUEUE /* * init kqueue and stuff diff --git a/sapi/fpm/fpm/events/poll.c b/sapi/fpm/fpm/events/poll.c index ad18d0bdea..0363c2ece1 100644 --- a/sapi/fpm/fpm/events/poll.c +++ b/sapi/fpm/fpm/events/poll.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#if HAVE_POLL +#ifdef HAVE_POLL #include #include @@ -52,7 +52,7 @@ static int next_free_slot = 0; */ struct fpm_event_module_s *fpm_event_poll_module() /* {{{ */ { -#if HAVE_POLL +#ifdef HAVE_POLL return &poll_module; #else return NULL; @@ -60,7 +60,7 @@ struct fpm_event_module_s *fpm_event_poll_module() /* {{{ */ } /* }}} */ -#if HAVE_POLL +#ifdef HAVE_POLL /* * Init the module diff --git a/sapi/fpm/fpm/events/port.c b/sapi/fpm/fpm/events/port.c index 7887c8e61a..d9aee3bfcd 100644 --- a/sapi/fpm/fpm/events/port.c +++ b/sapi/fpm/fpm/events/port.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#if HAVE_PORT +#ifdef HAVE_PORT #include #include @@ -49,7 +49,7 @@ static int pfd = -1; struct fpm_event_module_s *fpm_event_port_module() /* {{{ */ { -#if HAVE_PORT +#ifdef HAVE_PORT return &port_module; #else return NULL; @@ -57,7 +57,7 @@ struct fpm_event_module_s *fpm_event_port_module() /* {{{ */ } /* }}} */ -#if HAVE_PORT +#ifdef HAVE_PORT /* * Init the module diff --git a/sapi/fpm/fpm/events/select.c b/sapi/fpm/fpm/events/select.c index 23a5bb6d28..61b33c5569 100644 --- a/sapi/fpm/fpm/events/select.c +++ b/sapi/fpm/fpm/events/select.c @@ -19,7 +19,7 @@ #include "../fpm.h" #include "../zlog.h" -#if HAVE_SELECT +#ifdef HAVE_SELECT /* According to POSIX.1-2001 */ #include @@ -55,7 +55,7 @@ static fd_set fds; */ struct fpm_event_module_s *fpm_event_select_module() /* {{{ */ { -#if HAVE_SELECT +#ifdef HAVE_SELECT return &select_module; #else return NULL; @@ -63,7 +63,7 @@ struct fpm_event_module_s *fpm_event_select_module() /* {{{ */ } /* }}} */ -#if HAVE_SELECT +#ifdef HAVE_SELECT /* * Init the module diff --git a/sapi/fpm/fpm/fpm_clock.c b/sapi/fpm/fpm/fpm_clock.c index 8568d7928f..cd0bb7320c 100644 --- a/sapi/fpm/fpm/fpm_clock.c +++ b/sapi/fpm/fpm/fpm_clock.c @@ -2,7 +2,7 @@ #include "fpm_config.h" -#if defined(HAVE_CLOCK_GETTIME) +#ifdef HAVE_CLOCK_GETTIME #include /* for CLOCK_MONOTONIC */ #endif diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 166209bf46..8fab8d6bd2 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -33,11 +33,11 @@ #include #include "php.h" -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H # include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include #endif @@ -45,15 +45,15 @@ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_WAIT_H +#ifdef HAVE_SYS_WAIT_H # include #endif -#if HAVE_FCNTL_H +#ifdef HAVE_FCNTL_H # include #endif @@ -1807,7 +1807,7 @@ consult the installation file that came with this distribution, or visit \n\ the manual page.

\n"); } zend_catch { } zend_end_try(); -#if defined(ZTS) && !defined(PHP_DEBUG) +#if defined(ZTS) && !PHP_DEBUG /* XXX we're crashing here in msvc6 debug builds at * php_message_handler_for_zend:839 because * SG(request_info).path_translated is an invalid pointer. diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h index 9d899c0757..8f1e3846b2 100644 --- a/sapi/fpm/fpm/fpm_sockets.h +++ b/sapi/fpm/fpm/fpm_sockets.h @@ -14,7 +14,7 @@ /* On FreeBSD and OpenBSD, backlog negative values are truncated to SOMAXCONN */ -#if (__FreeBSD__) || (__OpenBSD__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) #define FPM_BACKLOG_DEFAULT -1 #else #define FPM_BACKLOG_DEFAULT 511 diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c index ddedfb48c7..1742467b36 100644 --- a/sapi/fpm/fpm/fpm_stdio.c +++ b/sapi/fpm/fpm/fpm_stdio.c @@ -49,7 +49,7 @@ static inline int fpm_use_error_log() { /* {{{ */ * - SysV init launch php-fpm as a daemon * - Systemd launch php-fpm in foreground */ -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) { #else if (fpm_global_config.daemonize) {