From: George Peter Banyard Date: Tue, 12 May 2020 16:02:35 +0000 (+0200) Subject: Fix [-Wundef] warning in FTP extension X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a18116dbacec661ee3758ee9a556da393072a61;p=php Fix [-Wundef] warning in FTP extension --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 71dc7f6691..f47e0a6d49 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -21,7 +21,7 @@ #include "php.h" -#if HAVE_FTP +#ifdef HAVE_FTP #include #include @@ -45,7 +45,7 @@ #endif #include -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif @@ -816,7 +816,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv) return 0; } -#if HAVE_IPV6 +#ifdef HAVE_IPV6 if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; char *endptr, delimiter; @@ -1719,7 +1719,7 @@ ftp_getdata(ftpbuf_t *ftp) data->listener = fd; -#if HAVE_IPV6 && HAVE_INET_NTOP +#if defined(HAVE_IPV6) && defined(HAVE_INET_NTOP) if (sa->sa_family == AF_INET6) { /* need to use EPRT */ char eprtarg[INET6_ADDRSTRLEN + sizeof("|x||xxxxx|")]; diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index f4030038f1..a5e5f50485 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -25,7 +25,7 @@ # include #endif -#if HAVE_FTP +#ifdef HAVE_FTP #include "ext/standard/info.h" #include "ext/standard/file.h" @@ -52,7 +52,7 @@ zend_module_entry php_ftp_module_entry = { STANDARD_MODULE_PROPERTIES }; -#if COMPILE_DL_FTP +#ifdef COMPILE_DL_FTP ZEND_GET_MODULE(php_ftp) #endif diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h index 4d18721284..60eba04adf 100644 --- a/ext/ftp/php_ftp.h +++ b/ext/ftp/php_ftp.h @@ -18,7 +18,7 @@ #ifndef _INCLUDED_FTP_H #define _INCLUDED_FTP_H -#if HAVE_FTP +#ifdef HAVE_FTP extern zend_module_entry php_ftp_module_entry; #define php_ftp_module_ptr &php_ftp_module_entry