/* A GNU-like <arpa/inet.h>.
- Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
#define _@GUARD_PREFIX@_ARPA_INET_H
+/* Get all possible declarations of inet_ntop() and inet_pton(). */
+#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \
+ && @HAVE_WS2TCPIP_H@
+# include <ws2tcpip.h>
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
the return value is NULL and errno is set to ENOSPC. A good value
for CNT is 46.
- For more details, see the POSIX:2001 specification
- <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
+ For more details, see the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>. */
# if @REPLACE_INET_NTOP@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef inet_ntop
(int af, const void *restrict src,
char *restrict dst, socklen_t cnt));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (inet_ntop);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef inet_ntop
# if HAVE_RAW_DECL_INET_NTOP
_GL_CXXALIAS_SYS (inet_pton, int,
(int af, const char *restrict src, void *restrict dst));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (inet_pton);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef inet_pton
# if HAVE_RAW_DECL_INET_PTON