/* Get address information (partial implementation).
- Copyright (C) 1997, 2001-2002, 2004-2011 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001-2002, 2004-2013 Free Software Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify
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, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#include <config.h>
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the sa == NULL test below. */
#define _GL_ARG_NONNULL(params)
+#include <config.h>
+
#include <netdb.h>
#if HAVE_NETINET_IN_H
#endif
#if defined _WIN32 || defined __WIN32__
-# define WIN32_NATIVE
+# define WINDOWS_NATIVE
#endif
/* gl_sockets_startup */
#include "sockets.h"
-#ifdef WIN32_NATIVE
+#ifdef WINDOWS_NATIVE
typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
const struct addrinfo*,
struct addrinfo**);
}
#endif
-static inline bool
+static bool
validate_family (int family)
{
/* FIXME: Support more families. */
};
#endif
-#ifdef WIN32_NATIVE
+#ifdef WINDOWS_NATIVE
if (use_win32_p ())
return getaddrinfo_ptr (nodename, servname, hints, res);
#endif
return 0;
}
-/* Free `addrinfo' structure AI including associated storage. */
+/* Free 'addrinfo' structure AI including associated storage. */
void
freeaddrinfo (struct addrinfo *ai)
{
-#ifdef WIN32_NATIVE
+#ifdef WINDOWS_NATIVE
if (use_win32_p ())
{
freeaddrinfo_ptr (ai);
char *restrict service, socklen_t servicelen,
int flags)
{
-#ifdef WIN32_NATIVE
+#ifdef WINDOWS_NATIVE
if (use_win32_p ())
return getnameinfo_ptr (sa, salen, node, nodelen,
service, servicelen, flags);