2 * Copyright (C) 2011-2012 Juho Vähä-Herttua
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
19 typedef int socklen_t
;
22 # define SHUT_RD SD_RECEIVE
25 # define SHUT_WR SD_SEND
28 # define SHUT_RDWR SD_BOTH
31 #define SOCKET_GET_ERROR() WSAGetLastError()
32 #define SOCKET_SET_ERROR(value) WSASetLastError(value)
33 #define SOCKET_ERRORNAME(name) WSA##name
35 #define WSAEAGAIN WSAEWOULDBLOCK
36 #define WSAENOMEM WSA_NOT_ENOUGH_MEMORY
40 #define closesocket close
41 #define ioctlsocket ioctl
43 #define SOCKET_GET_ERROR() (errno)
44 #define SOCKET_SET_ERROR(value) (errno = (value))
45 #define SOCKET_ERRORNAME(name) name