7 #if defined(G3D_LINUX) || defined(G3D_OSX) || defined(G3D_FREEBSD)
8 # include <sys/types.h>
9 # include <sys/socket.h>
11 # include <netinet/in.h>
14 # include <sys/ioctl.h>
15 # include <netinet/in.h>
19 # define AF_LINK AF_PACKET
21 # include <net/if_dl.h>
22 # include <sys/sockio.h>
27 #include <sys/socket.h>
28 #include <netinet/in.h>
29 #include <arpa/inet.h>
31 #include <netinet/tcp.h>
32 #include <sys/ioctl.h>
33 #include <netinet/if_ether.h>
34 #include <net/ethernet.h>
37 #include <sys/types.h>
39 #define _alloca alloca
42 int WSAGetLastError() {
46 #define SOCKET_ERROR -1
49 return G3D::format(
"CODE %d: %s\n", code, strerror(code));
56 static const int WSAEWOULDBLOCK = -100;
65 LPTSTR formatMsg =
NULL;
67 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
68 FORMAT_MESSAGE_IGNORE_INSERTS |
69 FORMAT_MESSAGE_FROM_SYSTEM,
77 return G3D::format(
"CODE %d: %s\n", code, formatMsg);
88 # if defined(G3D_WINDOWS) || defined(G3D_OSX)
89 typedef int socklen_t;
static std::string socketErrorCode(int code)
Definition: networkHelpers.h:64
arena_t NULL
Definition: jemalloc_internal.h:624
std::string __cdecl format(const char *fmt...) G3D_CHECK_PRINTF_ARGS
Definition: inftrees.h:24
int GetLastError()
Definition: Common.cpp:70