From: Islam Israfilov Date: Tue, 13 Aug 2019 11:11:49 +0000 (+0200) Subject: Add inet_ntop and inet_pton stubs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1dc88ff67e64a2fdd6ec7807758d7b88d577b4f9;p=php Add inet_ntop and inet_pton stubs --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index fbb435616f..0ae281c363 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -523,18 +523,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_constant, 0) ZEND_ARG_INFO(0, const_name) ZEND_END_ARG_INFO() -#ifdef HAVE_INET_NTOP -ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0) - ZEND_ARG_INFO(0, in_addr) -ZEND_END_ARG_INFO() -#endif - -#ifdef HAVE_INET_PTON -ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0) - ZEND_ARG_INFO(0, ip_address) -ZEND_END_ARG_INFO() -#endif - ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0) ZEND_ARG_INFO(0, ip_address) ZEND_END_ARG_INFO() diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 9d6833c639..fcc804f6f7 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -84,3 +84,13 @@ function closelog (): bool {} function syslog (int $priority, string $message): bool {} #endif + +#ifdef HAVE_INET_NTOP +/** @return string|false */ +function inet_ntop (string $in_addr) {} +#endif + +#ifdef HAVE_INET_PTON +/** @return string|false */ +function inet_pton (string $ip_address) {} +#endif diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index e3300cbcec..a32e8991f7 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -107,3 +107,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_END_ARG_INFO() #endif + +#if defined(HAVE_INET_NTOP) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inet_ntop, 0, 1, 0, 0) + ZEND_ARG_TYPE_INFO(0, in_addr, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_INET_PTON) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inet_pton, 0, 1, 0, 0) + ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif \ No newline at end of file