From 7bb6385ee34141771aac6e3e6e348c213d92f451 Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 2 Jul 2008 16:35:51 +0000 Subject: Fixing code for the latests mingw32 compilers. --- include/Task.h | 3 ++- lib/TaskMan.cc | 6 +++++- lib/lua/src/lapi.c | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/Task.h b/include/Task.h index 325d162..da09981 100644 --- a/include/Task.h +++ b/include/Task.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: Task.h,v 1.32 2008-02-18 09:55:08 pixel Exp $ */ +/* $Id: Task.h,v 1.33 2008-07-02 16:35:51 pixel Exp $ */ #ifndef __TASK_H__ #define __TASK_H__ @@ -33,6 +33,7 @@ #include #undef E_HANDLE +#undef Yield class Task : public Base { public: diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index 1752d8d..f42e8bd 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: TaskMan.cc,v 1.56 2008-07-02 10:05:16 pixel Exp $ */ +/* $Id: TaskMan.cc,v 1.57 2008-07-02 16:35:51 pixel Exp $ */ #ifndef _WIN32 #include @@ -237,7 +237,11 @@ static int poll (struct pollfd *fds, unsigned int nfds, int timeout) { return retval + n_non_socket; } +#ifdef _MSVC #define EPOCHFILETIME (116444736000000000i64) +#else +#define EPOCHFILETIME (116444736000000000LLU) +#endif // special version without timezone support... static int gettimeofday(struct timeval *tv, struct timezone *tz) diff --git a/lib/lua/src/lapi.c b/lib/lua/src/lapi.c index 32421e3..c2c898d 100644 --- a/lib/lua/src/lapi.c +++ b/lib/lua/src/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.8 2008-02-18 10:15:45 pixel Exp $ +** $Id: lapi.c,v 1.9 2008-07-02 16:35:51 pixel Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -93,14 +93,15 @@ void luaA_pushobject (lua_State *L, const TValue *o) { LUA_API int lua_checkstack (lua_State *L, int size) { - int res = 1; + int res; lua_lock(L); - if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) + if ((L->top - L->base + size) > LUAI_MAXCSTACK) res = 0; /* stack overflow */ - else if (size > 0) { + else { luaD_checkstack(L, size); if (L->ci->top < L->top + size) L->ci->top = L->top + size; + res = 1; } lua_unlock(L); return res; -- cgit v1.2.3