--- codelite/CodeLite/SocketAPI/clSocketBase.h.orig	2015-03-10 21:05:03.519200000 +0300
+++ codelite/CodeLite/SocketAPI/clSocketBase.h	2015-03-10 21:05:18.807200000 +0300
@@ -32,9 +32,9 @@
 #include "codelite_exports.h"
 
-#ifdef _WIN32
+#ifdef __WXMSW__
-#ifndef _WIN64
-#include <winsock2.h>
-#endif
+#define INCL_WINSOCK_API_TYPEDEFS 1
+#include <winsock2.h>
+#include <wx/msw/winundef.h>
 
 typedef SOCKET socket_t;
 typedef int socklen_t;
diff --git a/wxcrafter/wxcLib/clSocketBase.h b/wxcrafter/wxcLib/clSocketBase.h
index e97b5385c..0e89bcdfb 100644
--- a/wxcrafter/wxcLib/clSocketBase.h
+++ b/wxcrafter/wxcLib/clSocketBase.h
@@ -13,6 +13,9 @@
 
 
 #ifdef _WIN32
+#define INCL_WINSOCK_API_TYPEDEFS 1
+#include <winsock2.h>
+#include <wx/msw/winundef.h>
 typedef SOCKET socket_t;
 typedef int socklen_t;
 #else
