#ifdef NO_GETADDRINFO
#define USE_GETHOSTBYNAME
#endif
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <io.h>
#define MAXHOSTNAMELEN …
#include "win32_snprintf.h"
#define herror
#define socklen_t …
#else
#include <unistd.h>
#include <sys/types.h>
#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT
#include <sys/time.h>
#endif
#include <sys/param.h>
#include <sys/select.h>
#include <errno.h>
#define closesocket …
#include <netdb.h>
#include <netinet/in.h>
#define MINIUPNPC_IGNORE_EINTR
#include <sys/socket.h>
#include <sys/select.h>
#endif
#if defined(__amigaos__) || defined(__amigaos4__)
#define herror …
#endif
#include "connecthostport.h"
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN …
#endif
SOCKET connecthostport(const char * host, unsigned short port,
unsigned int scope_id)
{ … }