Fixed compiler warnings on Windows.
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 9912aa5..ef4a3c5 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -22,7 +22,8 @@
 #include "private-libwebsockets.h"
 
 #ifdef WIN32
-
+#include <tchar.h>
+#include <io.h>
 #else
 #include <ifaddrs.h>
 #include <sys/un.h>
@@ -444,7 +445,9 @@
 	char ip[128];
 	unsigned char *p;
 	int n;
-	struct sockaddr_un *un;
+#ifdef AF_LOCAL
+    struct sockaddr_un *un;
+#endif
 
 	rip[0] = '\0';
 	name[0] = '\0';
@@ -948,7 +951,7 @@
 	p += strlen(wsi->key_b64);
 	p += sprintf(p, "\x0d\x0a");
 	if (wsi->c_origin)
-		p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a",
+		    p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a",
 							 wsi->c_origin);
 	if (wsi->c_protocol)
 		p += sprintf(p, "Sec-WebSocket-Protocol: %s\x0d\x0a",
@@ -2557,7 +2560,7 @@
 		poll = emulated_poll;
 
 		/* if windows socket lib available, use his WSAPoll */
-		wsdll = GetModuleHandle("Ws2_32.dll");
+		wsdll = GetModuleHandle(_T("Ws2_32.dll"));
 		if (wsdll)
 			poll = (PFNWSAPOLL)GetProcAddress(wsdll, "WSAPoll");
 	}