aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2009-07-15 10:39:10 -0400
committerThomas Harning Jr <harningt@gmail.com>2009-07-15 10:39:10 -0400
commit6a0484672751e17fbd8d410335be658528999528 (patch)
tree2d162df1f49885106239d7e9dfc9734f604e26e4
parent5f579c5332b34cb2cf67db004c2d93086d8c4187 (diff)
parent6fa683a710475b7fcacff0bd40ed5940f764747e (diff)
downloadluaevent-prosody-6a0484672751e17fbd8d410335be658528999528.tar.gz
luaevent-prosody-6a0484672751e17fbd8d410335be658528999528.zip
Merge branch 'v0.2'
-rw-r--r--src/luaevent.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/luaevent.c b/src/luaevent.c
index b356c92..c9b5430 100644
--- a/src/luaevent.c
+++ b/src/luaevent.c
@@ -12,6 +12,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);
}
@@ -127,6 +131,12 @@ void setNamedIntegers(lua_State* L, namedInteger* p) {
/* 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);
@@ -145,3 +155,4 @@ int luaopen_luaevent_core(lua_State* L) {
setNamedIntegers(L, consts);
return 1;
}
+