aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/mingw/libsrc/wspiapi/WspiapiGetAddrInfo.c
blob: cc235f7aa42f5a6aef103f9fe881bb92ef92b2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#undef  __CRT__NO_INLINE
#define __CRT__NO_INLINE
#include <winsock2.h>
#include <wspiapi.h>

int WINAPI
WspiapiGetAddrInfo(const char *nodename, const char *servname,
		   const struct addrinfo *hints, struct addrinfo **res)
{
  static WSPIAPI_PGETADDRINFO pfGetAddrInfo = NULL;
  int err;

  if (!pfGetAddrInfo)
    pfGetAddrInfo = (void*) WspiapiLoad (0);
  err = (*pfGetAddrInfo) (nodename, servname, hints, res);
  WSASetLastError (err);
  return err;
}