diff options
author | blastbeat <blastbeat@arcor.de> | 2009-07-15 10:38:52 -0400 |
---|---|---|
committer | blastbeat <blastbeat@arcor.de> | 2009-07-15 10:38:52 -0400 |
commit | 6fa683a710475b7fcacff0bd40ed5940f764747e (patch) | |
tree | 1e88eaed131a6b89a8ac78757fa384776b7eb055 | |
parent | e54be68770789933411ec8e7e0d99876cb4ebb89 (diff) | |
download | luaevent-prosody-6fa683a710475b7fcacff0bd40ed5940f764747e.tar.gz luaevent-prosody-6fa683a710475b7fcacff0bd40ed5940f764747e.zip |
base: add patch to get luaevent working on mingw
-rw-r--r-- | src/luaevent.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/luaevent.c b/src/luaevent.c index c1428c1..d352cdc 100644 --- a/src/luaevent.c +++ b/src/luaevent.c @@ -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 @@ 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); @@ -134,3 +144,4 @@ int luaopen_luaevent_core(lua_State* L) { setNamedIntegers(L, consts); return 1; } + |