Remove HAVE_INET_PTON - #13410
Remove HAVE_INET_PTON#13410
Conversation
fe53851 to
e7e7a25
Compare
|
Thanks @jorgsowa, I think this is logical indeed, if inet_pton is universally available on the current systems. Then probably also these tests can be simplified in the SKIPIF sections:
|
|
@petk Thanks for review. Tests adjusted |
|
Perfect, thanks. I'm not sure if this would be too much for this PR, but probably also the inet_aton can be now completely made obsolete and can be removed together with the Windows implementation file(s). The inet_aton is deprecated anyway. If I'm not mistaken... |
I m not objecting neither. If the OP does not want to go any further, it looks good already. |
No problem to me. I will cover it in the next PR. 🙂 |
|
|
||
| if (hostname == NULL) { | ||
| #if defined(HAVE_IPV6) && defined(HAVE_INET_PTON) | ||
| #if defined(HAVE_IPV6) |
There was a problem hiding this comment.
| #if defined(HAVE_IPV6) | |
| #ifdef HAVE_IPV6 |
| static zend_string *php_gethostbyaddr(char *ip) | ||
| { | ||
| #if defined(HAVE_IPV6) && defined(HAVE_INET_PTON) | ||
| #if defined(HAVE_IPV6) |
There was a problem hiding this comment.
| #if defined(HAVE_IPV6) | |
| #ifdef HAVE_IPV6 |
| if(PHP_INT_SIZE != 4) { die('skip 32 bit only'); } | ||
| if(strtolower(substr(PHP_OS, 0, 3)) == 'aix') { die('skip not for AIX'); } |
| /* first, try interpreting the address as a numeric address */ | ||
|
|
||
| #if HAVE_IPV6 && HAVE_INET_PTON | ||
| #if HAVE_IPV6 |
There was a problem hiding this comment.
| #if HAVE_IPV6 | |
| #ifdef HAVE_IPV6 |
think it should always test definition
There was a problem hiding this comment.
Agreed, I have a long-standing (very outdated PR (#5526) now) to try to enable -Wundef to check these sorts of issues at compile time.
There was a problem hiding this comment.
Do you need help with this PR, @Girgias ?
There was a problem hiding this comment.
You can take it over, I was hitting some issue with YACC generating something that I couldn't check.
| struct sockaddr common; | ||
| struct sockaddr_in in4; | ||
| #if HAVE_IPV6 && HAVE_INET_PTON | ||
| #if HAVE_IPV6 |
There was a problem hiding this comment.
| #if HAVE_IPV6 | |
| #ifdef HAVE_IPV6 |
| } | ||
| } | ||
| #if HAVE_IPV6 && HAVE_INET_PTON | ||
| #if HAVE_IPV6 |
There was a problem hiding this comment.
| #if HAVE_IPV6 | |
| #ifdef HAVE_IPV6 |
| ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i))) | ||
|
|
||
| #if defined(HAVE_IPV6) && defined(HAVE_INET_PTON) | ||
| #if defined(HAVE_IPV6) |
There was a problem hiding this comment.
| #if defined(HAVE_IPV6) | |
| #ifdef HAVE_IPV6 |
| /* first, try interpreting the address as a numeric address */ | ||
|
|
||
| #if HAVE_IPV6 && HAVE_INET_PTON | ||
| #if HAVE_IPV6 |
There was a problem hiding this comment.
Agreed, I have a long-standing (very outdated PR (#5526) now) to try to enable -Wundef to check these sorts of issues at compile time.
|
Thank you all for the reviews. If I should add something else then please let me know. Otherwise, I don't know who should I ask for approval and merge now. |
Analogical change to #12700
When
inet_ntopis available theninet_ptonalso.