summaryrefslogtreecommitdiff
path: root/lib/libwebsockets.c
diff options
context:
space:
mode:
authorDavid Galeano <davidgaleano@turbulenz.biz>2011-10-04 19:55:18 +0800
committerAndy Green <andy.green@linaro.org>2011-10-04 19:55:18 +0800
commit7b11fec7ca91be742d6c96cb27ee9fca015e456c (patch)
tree1aec9da74321ed40a18423152166cd0116e38906 /lib/libwebsockets.c
parent08d60f187609467b4006aabc6223ecf6c2ba1c99 (diff)
Added support for Windows XP.
Diffstat (limited to 'lib/libwebsockets.c')
-rw-r--r--lib/libwebsockets.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 5376ea1..50aeaee 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -2501,6 +2501,7 @@ libwebsocket_create_context(int port, const char *interf,
WORD wVersionRequested;
WSADATA wsaData;
int err;
+ HMODULE wsdll;
/* Use the MAKEWORD(lowbyte, highbyte) macro from Windef.h */
wVersionRequested = MAKEWORD(2, 2);
@@ -2513,6 +2514,17 @@ libwebsocket_create_context(int port, const char *interf,
err);
return NULL;
}
+
+ wsdll = GetModuleHandle("Ws2_32.dll");
+ if (wsdll)
+ {
+ poll = (PFNWSAPOLL)GetProcAddress(wsdll, "WSAPoll");
+ }
+
+ if (!poll)
+ {
+ poll = emulated_poll;
+ }
}
#endif