There are some predefined symbols missing that prevent it to compile on windows with mingw.
I tryied using a macro wrapper on then but some of then are not defined on windows so probably we need define an enum for then.
#ifdef _WIN32
#define P_M(a) WSA##a
#else
#define P_M(a) a
#endif
{P_M(EADDRINUSE), "address already in use"},
{P_M(EADDRNOTAVAIL), "address not available"},
{P_M(EAFNOSUPPORT), "address family not supported"},
{P_M(EALREADY), "connection already in progress"},
{P_M(EBADMSG), "bad message"},
{P_M(ECANCELED), "operation canceled"},
{P_M(ECONNABORTED), "connection aborted"},
{P_M(ECONNREFUSED), "connection refused"},
{P_M(ECONNRESET), "connection reset"},
{P_M(EDESTADDRREQ), "destination address required"},
{P_M(EHOSTUNREACH), "host is unreachable"},
{P_M(EIDRM), "identifier removed"},
{P_M(EINPROGRESS), "operation in progress"},
{P_M(EISCONN), "socket is connected"},
{P_M(ELOOP), "too many levels of symbolic links"},
{P_M(EMSGSIZE), "message too long"},
{P_M(ENETDOWN), "network is down"},
{P_M(ENETRESET), "connection aborted by network"},
{P_M(ENETUNREACH), "network unreachable"},
{P_M(ENOBUFS), "no buffer space available"},
{P_M(ENODATA), "no message is available"},
{P_M(ENOLINK), "link has been severed"},
{P_M(ENOMSG), "no message of the desired type"},
{P_M(ENOPROTOOPT), "protocol not available"},
{P_M(ENOSR), "no stream resources"},
{P_M(ENOSTR), "not a stream"},
{P_M(ENOTCONN), "the socket is not connected"},
{P_M(ENOTRECOVERABLE), "state not recoverable"},
{P_M(ENOTSOCK), "not a socket"},
{P_M(ENOTSUP), "operation not supported"},
{P_M(EOVERFLOW), "value too large too be stored in datatype"},
{P_M(EOWNERDEAD), "owner died"},
{P_M(EPROTO), "protocol error"},
{P_M(EPROTONOSUPPORT), "protocol not supported"},
{P_M(EPROTOTYPE), "protocol wrong type for socket"},
{P_M(ETIME), "timer expired"},
{P_M(ETIMEDOUT), "connection timed out"},
{P_M(ETXTBSY), "text file busy"},