base: add patch to get luaevent working on mingw default/v0.2 v0.2

Wed, 15 Jul 2009 10:38:52 -0400

author
blastbeat <blastbeat@arcor.de>
date
Wed, 15 Jul 2009 10:38:52 -0400
changeset 63
1b8cbf640378
parent 39
a0a7f7ebca3f
child 64
dd47dbe85bec

base: add patch to get luaevent working on mingw

src/luaevent.c file | annotate | diff | comparison | revisions
--- a/src/luaevent.c	Fri Sep 21 12:10:52 2007 -0400
+++ b/src/luaevent.c	Wed Jul 15 10:38:52 2009 -0400
@@ -11,6 +11,10 @@
 
 #define EVENT_BASE_MT "EVENT_BASE_MT"
 
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
 le_base* event_base_get(lua_State* L, int idx) {
 	return (le_base*)luaL_checkudata(L, idx, EVENT_BASE_MT);
 }
@@ -118,6 +122,12 @@
 
 /* Verified ok */
 int luaopen_luaevent_core(lua_State* L) {
+#ifdef _WIN32
+	WORD wVersionRequested = MAKEWORD(2, 2);
+	WSADATA wsaData;
+	WSAStartup(wVersionRequested, &wsaData);
+#endif
+	event_init( );
 	/* Register external items */
 	event_callback_register(L);
 	event_buffer_register(L);
@@ -134,3 +144,4 @@
 	setNamedIntegers(L, consts);
 	return 1;
 }
+

mercurial