Skip to content

Commit 1dc88ff

Browse files
Islam Israfilovcmb69
Islam Israfilov
authored andcommitted
Add inet_ntop and inet_pton stubs
1 parent e7ac942 commit 1dc88ff

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

ext/standard/basic_functions.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -523,18 +523,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
523523
ZEND_ARG_INFO(0, const_name)
524524
ZEND_END_ARG_INFO()
525525

526-
#ifdef HAVE_INET_NTOP
527-
ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
528-
ZEND_ARG_INFO(0, in_addr)
529-
ZEND_END_ARG_INFO()
530-
#endif
531-
532-
#ifdef HAVE_INET_PTON
533-
ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
534-
ZEND_ARG_INFO(0, ip_address)
535-
ZEND_END_ARG_INFO()
536-
#endif
537-
538526
ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
539527
ZEND_ARG_INFO(0, ip_address)
540528
ZEND_END_ARG_INFO()

ext/standard/basic_functions.stub.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,13 @@ function closelog (): bool {}
8484

8585
function syslog (int $priority, string $message): bool {}
8686
#endif
87+
88+
#ifdef HAVE_INET_NTOP
89+
/** @return string|false */
90+
function inet_ntop (string $in_addr) {}
91+
#endif
92+
93+
#ifdef HAVE_INET_PTON
94+
/** @return string|false */
95+
function inet_pton (string $ip_address) {}
96+
#endif

ext/standard/basic_functions_arginfo.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, _IS_BOOL, 0)
107107
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
108108
ZEND_END_ARG_INFO()
109109
#endif
110+
111+
#if defined(HAVE_INET_NTOP)
112+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inet_ntop, 0, 1, 0, 0)
113+
ZEND_ARG_TYPE_INFO(0, in_addr, IS_STRING, 0)
114+
ZEND_END_ARG_INFO()
115+
#endif
116+
117+
#if defined(HAVE_INET_PTON)
118+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inet_pton, 0, 1, 0, 0)
119+
ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0)
120+
ZEND_END_ARG_INFO()
121+
#endif

0 commit comments

Comments
 (0)