From 80b7acea2eb19f7facddce17733b88cb50a56cea Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 17 Jun 2004 00:18:48 +0000 Subject: Compiled and tested on Windows... --- src/inet.h | 2 +- src/luasocket.c | 7 ------- src/mime.c | 7 ------- src/select.c | 4 +--- src/socket.h | 2 +- src/timeout.c | 6 +++--- 6 files changed, 6 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/inet.h b/src/inet.h index 92e16f8..4b3639a 100644 --- a/src/inet.h +++ b/src/inet.h @@ -20,7 +20,7 @@ #include "socket.h" #include "timeout.h" -#ifdef WIN32 +#ifdef _WIN32 #define INET_ATON #endif diff --git a/src/luasocket.c b/src/luasocket.c index 2b0a1fa..6f7debe 100644 --- a/src/luasocket.c +++ b/src/luasocket.c @@ -87,13 +87,6 @@ static int base_open(lua_State *L) { /* whoever is loading the library replaced the global environment * with the namespace table */ lua_pushvalue(L, LUA_GLOBALSINDEX); - /* make sure library is still "requirable" if initialized staticaly */ - lua_pushstring(L, "_LOADEDLIB"); - lua_gettable(L, -2); - lua_pushstring(L, LUASOCKET_LIBNAME); - lua_pushcfunction(L, (lua_CFunction) luaopen_socket); - lua_settable(L, -3); - lua_pop(L, 1); #ifdef LUASOCKET_DEBUG lua_pushstring(L, "DEBUG"); lua_pushboolean(L, 1); diff --git a/src/mime.c b/src/mime.c index 825b666..7810580 100644 --- a/src/mime.c +++ b/src/mime.c @@ -79,13 +79,6 @@ MIME_API int luaopen_mime(lua_State *L) /* whoever is loading the library replaced the global environment * with the namespace table */ lua_pushvalue(L, LUA_GLOBALSINDEX); - /* make sure library is still "requirable" if initialized staticaly */ - lua_pushstring(L, "_LOADEDLIB"); - lua_gettable(L, -2); - lua_pushstring(L, MIME_LIBNAME); - lua_pushcfunction(L, (lua_CFunction) luaopen_mime); - lua_settable(L, -3); - lua_pop(L, 1); /* export functions */ luaL_openlib(L, NULL, func, 0); /* initialize lookup tables */ diff --git a/src/select.c b/src/select.c index 13f9d6e..49730d1 100644 --- a/src/select.c +++ b/src/select.c @@ -71,8 +71,6 @@ static int global_select(lua_State *L) { lua_pushstring(L, "timeout"); return 3; } else { - lua_pushnil(L); - lua_pushnil(L); lua_pushstring(L, "error"); return 3; } @@ -89,7 +87,7 @@ static int getfd(lua_State *L) { lua_pushvalue(L, -2); lua_call(L, 1, 1); if (lua_isnumber(L, -1)) - fd = lua_tonumber(L, -1); + fd = (int) lua_tonumber(L, -1); } lua_pop(L, 1); return fd; diff --git a/src/socket.h b/src/socket.h index 85e8848..3dac875 100644 --- a/src/socket.h +++ b/src/socket.h @@ -16,7 +16,7 @@ /*=========================================================================*\ * Platform specific compatibilization \*=========================================================================*/ -#ifdef WIN32 +#ifdef _WIN32 #include "wsocket.h" #else #include "usocket.h" diff --git a/src/timeout.c b/src/timeout.c index 4f9a315..3472ca7 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -13,7 +13,7 @@ #include "auxiliar.h" #include "timeout.h" -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -133,7 +133,7 @@ p_tm tm_markstart(p_tm tm) * Returns * time in ms. \*-------------------------------------------------------------------------*/ -#ifdef WIN32 +#ifdef _WIN32 int tm_gettime(void) { return GetTickCount(); @@ -198,7 +198,7 @@ static int tm_lua_time(lua_State *L) int tm_lua_sleep(lua_State *L) { double n = luaL_checknumber(L, 1); -#ifdef WIN32 +#ifdef _WIN32 Sleep((int)n*1000); #else sleep((int)n); -- cgit v1.2.3-55-g6feb