/* Get address information (partial implementation).
- Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 1997, 2001-2002, 2004-2011 Free Software Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify
#include <config.h>
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the sa == NULL test below. */
+#define _GL_ARG_NONNULL(params)
+
#include <netdb.h>
#if HAVE_NETINET_IN_H
# define WIN32_NATIVE
#endif
+/* gl_sockets_startup */
+#include "sockets.h"
+
#ifdef WIN32_NATIVE
typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
const struct addrinfo*,
return 0;
}
+ gl_sockets_startup (SOCKETS_1_1);
+
return 1;
}
#endif
}
}
-int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
- char *restrict node, socklen_t nodelen,
- char *restrict service, socklen_t servicelen,
- int flags)
+int
+getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
+ char *restrict node, socklen_t nodelen,
+ char *restrict service, socklen_t servicelen,
+ int flags)
{
#ifdef WIN32_NATIVE
if (use_win32_p ())