mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
inet_ntop requirement check at configure time instead (#12700)
This commit is contained in:
@@ -525,9 +525,7 @@ static const func_info_t func_infos[] = {
|
||||
F1("md5_file", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
F1("sha1", MAY_BE_STRING),
|
||||
F1("sha1_file", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
#if defined(HAVE_INET_NTOP)
|
||||
F1("inet_ntop", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
#endif
|
||||
#if defined(HAVE_INET_PTON)
|
||||
F1("inet_pton", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
#endif
|
||||
|
||||
@@ -609,7 +609,6 @@ getgrnam_r \
|
||||
getpwuid_r \
|
||||
getwd \
|
||||
glob \
|
||||
inet_ntop \
|
||||
inet_pton \
|
||||
localtime_r \
|
||||
lchown \
|
||||
@@ -646,6 +645,11 @@ memmem \
|
||||
memrchr \
|
||||
)
|
||||
|
||||
AC_CHECK_FUNCS(inet_ntop,[],[
|
||||
AC_MSG_ERROR([Cannot find inet_ntop which is required])
|
||||
]
|
||||
)
|
||||
|
||||
dnl Check for strerror_r, and if its a POSIX-compatible or a GNU specific version.
|
||||
AC_FUNC_STRERROR_R
|
||||
|
||||
|
||||
@@ -56,10 +56,6 @@
|
||||
#include <openssl/err.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
#error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
#include "ftp.h"
|
||||
#include "ext/standard/fsock.h"
|
||||
|
||||
@@ -1695,9 +1691,9 @@ ftp_getdata(ftpbuf_t *ftp)
|
||||
char eprtarg[INET6_ADDRSTRLEN + sizeof("|x||xxxxx|")];
|
||||
char out[INET6_ADDRSTRLEN];
|
||||
int eprtarg_len;
|
||||
if (!inet_ntop(AF_INET6, &((struct sockaddr_in6*) sa)->sin6_addr, out, sizeof(out))) {
|
||||
goto bail;
|
||||
}
|
||||
const char *r;
|
||||
r = inet_ntop(AF_INET6, &((struct sockaddr_in6*) sa)->sin6_addr, out, sizeof(out));
|
||||
ZEND_ASSERT(r != NULL);
|
||||
|
||||
eprtarg_len = snprintf(eprtarg, sizeof(eprtarg), "|2|%s|%hu|", out, ntohs(((struct sockaddr_in6 *) &addr)->sin6_port));
|
||||
|
||||
|
||||
@@ -51,10 +51,6 @@
|
||||
#endif
|
||||
#include <locale.h>
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
#error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
#ifndef __P
|
||||
#ifdef __GNUC__
|
||||
#define __P(args) args
|
||||
|
||||
@@ -218,10 +218,6 @@ zend_module_entry sockets_module_entry = {
|
||||
ZEND_GET_MODULE(sockets)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
#error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
static bool php_open_listen_sock(php_socket *sock, int port, int backlog) /* {{{ */
|
||||
{
|
||||
struct sockaddr_in la;
|
||||
|
||||
@@ -102,10 +102,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
# define INADDR_NONE ((zend_ulong) -1)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
# error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
#include "zend_globals.h"
|
||||
#include "php_globals.h"
|
||||
#include "SAPI.h"
|
||||
@@ -636,9 +632,7 @@ PHP_FUNCTION(long2ip)
|
||||
zend_ulong ip;
|
||||
zend_long sip;
|
||||
struct in_addr myaddr;
|
||||
#ifdef HAVE_INET_PTON
|
||||
char str[40];
|
||||
#endif
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_LONG(sip)
|
||||
|
||||
@@ -2207,10 +2207,8 @@ function closelog(): true {}
|
||||
function syslog(int $priority, string $message): true {} // TODO make return type void
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INET_NTOP
|
||||
/** @refcount 1 */
|
||||
function inet_ntop(string $ip): string|false {}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INET_PTON
|
||||
/** @refcount 1 */
|
||||
|
||||
12
ext/standard/basic_functions_arginfo.h
generated
12
ext/standard/basic_functions_arginfo.h
generated
@@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 487cee0751d47b18bf0a8fbdb050313783f1b369 */
|
||||
* Stub hash: ef14c8ce17c75ee21befd09477934f005eabb1ed */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
|
||||
@@ -720,11 +720,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, IS_TRUE, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_INET_NTOP)
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inet_ntop, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
#define arginfo_inet_ntop arginfo_gethostbyaddr
|
||||
|
||||
#if defined(HAVE_INET_PTON)
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inet_pton, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
|
||||
@@ -2415,9 +2411,7 @@ ZEND_FUNCTION(closelog);
|
||||
#if defined(HAVE_SYSLOG_H)
|
||||
ZEND_FUNCTION(syslog);
|
||||
#endif
|
||||
#if defined(HAVE_INET_NTOP)
|
||||
ZEND_FUNCTION(inet_ntop);
|
||||
#endif
|
||||
#if defined(HAVE_INET_PTON)
|
||||
ZEND_FUNCTION(inet_pton);
|
||||
#endif
|
||||
@@ -3050,9 +3044,7 @@ static const zend_function_entry ext_functions[] = {
|
||||
#if defined(HAVE_SYSLOG_H)
|
||||
ZEND_FE(syslog, arginfo_syslog)
|
||||
#endif
|
||||
#if defined(HAVE_INET_NTOP)
|
||||
ZEND_FE(inet_ntop, arginfo_inet_ntop)
|
||||
#endif
|
||||
#if defined(HAVE_INET_PTON)
|
||||
ZEND_FE(inet_pton, arginfo_inet_pton)
|
||||
#endif
|
||||
|
||||
@@ -57,10 +57,6 @@ extern void __res_ndestroy(res_state statp);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
#error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 255
|
||||
#endif
|
||||
|
||||
@@ -47,10 +47,6 @@
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
#error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr) {
|
||||
socklen_t addrlen = sizeof(struct sockaddr_in);
|
||||
|
||||
|
||||
@@ -60,10 +60,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
#error inet_ntop unsupported on this platform
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_INET_ATON
|
||||
int inet_aton(const char *, struct in_addr *);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user