diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 6e30418e06209..91c0e6438ea12 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -48,6 +48,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES - The configure option --with-pspell has been removed. - Symbol SIZEOF_SHORT removed (size of 2 on 32-bit and 64-bit platforms). - Symbol DBA_CDB_MAKE removed in ext/dba. + - Symbol HAVE_INET_ATON and function inet_aton removed. b. Unix build system changes - The configure option --with-imap-ssl has been removed. diff --git a/configure.ac b/configure.ac index bdf5183d1c173..1ec8c8b36bd6f 100644 --- a/configure.ac +++ b/configure.ac @@ -375,9 +375,6 @@ case $host_alias in ;; esac -dnl Check for inet_aton in -lc and -lresolv. -PHP_CHECK_FUNC(inet_aton, resolv) - dnl Then headers. dnl ---------------------------------------------------------------------------- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index d82a6f7cd702d..7413343433849 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -30,7 +30,6 @@ #include "php_ini.h" #ifdef PHP_WIN32 # include "windows_common.h" -# include # include # include # include "php_sockets.h" diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 87b4e7571c6af..9dddfdc782e27 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -68,8 +68,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #ifndef PHP_WIN32 # include -#else -#include "win32/inet.h" #endif #ifdef HAVE_ARPA_INET_H diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 5857351688da2..d56616837f68f 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -25,7 +25,6 @@ #endif #ifdef PHP_WIN32 -# include "win32/inet.h" # include # include # include diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index 8622ec1aeca98..50ad961f00492 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -149,69 +149,3 @@ PHPAPI int php_flock(int fd, int operation) return 0; } #endif - -#ifndef PHP_WIN32 -#ifndef HAVE_INET_ATON -/* {{{ inet_aton - * Check whether "cp" is a valid ascii representation - * of an Internet address and convert to a binary address. - * Returns 1 if the address is valid, 0 if not. - * This replaces inet_addr, the return value from which - * cannot distinguish between failure and a local broadcast address. - */ -int inet_aton(const char *cp, struct in_addr *ap) -{ - int dots = 0; - unsigned long acc = 0, addr = 0; - - do { - char cc = *cp; - - switch (cc) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - acc = acc * 10 + (cc - '0'); - break; - - case '.': - if (++dots > 3) { - return 0; - } - /* Fall through */ - - case '\0': - if (acc > 255) { - return 0; - } - addr = addr << 8 | acc; - acc = 0; - break; - - default: - return 0; - } - } while (*cp++) ; - - /* Normalize the address */ - if (dots < 3) { - addr <<= 8 * (3 - dots) ; - } - - /* Store it if requested */ - if (ap) { - ap->s_addr = htonl(addr); - } - - return 1; -} -/* }}} */ -#endif /* !HAVE_INET_ATON */ -#endif diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index a55c3af9ca8f7..af0739bf15284 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -57,16 +57,4 @@ PHPAPI int flock(int fd, int operation); # define ftruncate(a, b) chsize(a, b) #endif /* defined(PHP_WIN32) */ -#ifndef HAVE_INET_ATON -# ifdef HAVE_NETINET_IN_H -# include -# endif -# ifdef HAVE_ARPA_INET_H -# include -# endif -# ifndef PHP_WIN32 -extern int inet_aton(const char *, struct in_addr *); -# endif -#endif - #endif /* FLOCK_COMPAT_H */ diff --git a/main/network.c b/main/network.c index a8de15936d108..8a2f1a56c6255 100644 --- a/main/network.c +++ b/main/network.c @@ -25,7 +25,6 @@ #ifdef PHP_WIN32 # include -# include "win32/inet.h" # include "win32/winutil.h" # define O_RDONLY _O_RDONLY # include "win32/param.h" @@ -60,10 +59,6 @@ #endif #endif -#ifndef HAVE_INET_ATON -int inet_aton(const char *, struct in_addr *); -#endif - #include "php_network.h" #if defined(PHP_WIN32) || defined(__riscos__) diff --git a/main/php_network.h b/main/php_network.h index 0f155211d8fc7..a31bc57b76aee 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -19,9 +19,7 @@ #include -#ifdef PHP_WIN32 -# include "win32/inet.h" -#else +#ifndef PHP_WIN32 # undef closesocket # define closesocket close # include diff --git a/win32/build/config.w32 b/win32/build/config.w32 index ef11223c662b2..a1e9d92cbd0ca 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -307,7 +307,7 @@ if (VS_TOOLSET && VCVERS >= 1914) { ADD_SOURCES("win32", "dllmain.c glob.c readdir.c \ registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c \ getrusage.c ftok.c ioutil.c codepage.c nice.c \ - inet.c fnmatch.c sockets.c console.c signal.c"); + fnmatch.c sockets.c console.c signal.c"); ADD_FLAG("CFLAGS_BD_WIN32", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); if (VS_TOOLSET && VCVERS >= 1914) { diff --git a/win32/inet.c b/win32/inet.c deleted file mode 100644 index 3d5a847eb6eb1..0000000000000 --- a/win32/inet.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Pierre Joye | - +----------------------------------------------------------------------+ - */ - -#include "inet.h" - -int inet_aton(const char *cp, struct in_addr *inp) { - inp->s_addr = inet_addr(cp); - - if (inp->s_addr == INADDR_NONE) { - return 0; - } - - return 1; -} diff --git a/win32/inet.h b/win32/inet.h deleted file mode 100644 index 6344051faa94a..0000000000000 --- a/win32/inet.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Pierre Joye | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_WIN32_INET_H -#define PHP_WIN32_INET_H - -#include -#include - -PHPAPI int inet_aton(const char *cp, struct in_addr *inp); - -#endif diff --git a/win32/sendmail.c b/win32/sendmail.c index 6263eaac1a094..dcd350c02720b 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -29,7 +29,6 @@ #include #include "sendmail.h" #include "php_ini.h" -#include "inet.h" #include "php_win32_globals.h"