]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
inet_pton, inet_ntop: drop declarations when unused
authorViktor Szakats <commit@vsz.me>
Sun, 27 Jul 2025 22:03:03 +0000 (00:03 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 27 Jul 2025 23:51:55 +0000 (01:51 +0200)
Do not declare local inet_pton/inet_ntop implementations when they are
not used. In this case the same symbol is defined as a macro and mapped
to the system implementation.

Syncing this with their definitions.

Closes #18043

lib/curlx/inet_ntop.h
lib/curlx/inet_pton.h

index 68f8c8d132d98a2265b029feffa74ae47a6c5317..490f49e8a195e9e4716e49257542b2b1b2189215 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "../curl_setup.h"
 
-char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
-
 #ifdef HAVE_INET_NTOP
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
@@ -46,6 +44,8 @@ char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
 #define curlx_inet_ntop(af,addr,buf,size)                \
   inet_ntop(af, addr, buf, (curl_socklen_t)(size))
 #endif
-#endif
+#else
+char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
+#endif /* HAVE_INET_NTOP */
 
 #endif /* HEADER_CURL_INET_NTOP_H */
index 610b329f51d64fac63511ee97e54bba0aa035269..a9ad24c9447f1e43676271af4a6497b9035f23c2 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "../curl_setup.h"
 
-int curlx_inet_pton(int, const char *, void *);
-
 #ifdef HAVE_INET_PTON
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
@@ -43,6 +41,8 @@ int curlx_inet_pton(int, const char *, void *);
 #else
 #define curlx_inet_pton(x,y,z) inet_pton(x,y,z)
 #endif
-#endif
+#else
+int curlx_inet_pton(int, const char *, void *);
+#endif /* HAVE_INET_PTON */
 
 #endif /* HEADER_CURL_INET_PTON_H */