diff options
author | scuri <scuri> | 2010-10-13 19:19:03 +0000 |
---|---|---|
committer | scuri <scuri> | 2010-10-13 19:19:03 +0000 |
commit | eef7ae01a9757f5e4a0693d539ee1fac5b09e756 (patch) | |
tree | 115563a582bdfc2df884eed611eec530db246142 /src/lua5 | |
parent | ccb038c14044d74e1a56f8fa20a9b3d958888735 (diff) |
*** empty log message ***
Diffstat (limited to 'src/lua5')
-rw-r--r-- | src/lua5/cdlua5ctx.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lua5/cdlua5ctx.c b/src/lua5/cdlua5ctx.c index 71f090d..e6812ff 100644 --- a/src/lua5/cdlua5ctx.c +++ b/src/lua5/cdlua5ctx.c @@ -1,5 +1,5 @@ /***************************************************************************\ -* $Id: cdlua5ctx.c,v 1.4 2010/06/11 17:28:56 scuri Exp $ +* $Id: cdlua5ctx.c,v 1.5 2010/10/13 19:19:05 scuri Exp $ * * \***************************************************************************/ @@ -835,14 +835,14 @@ static int clipboard_sizecb(cdCanvas *canvas, int w, int h, double mm_w, double \***************************************************************************/ static void *cdnativewindow_checkdata(lua_State *L, int param) { -#ifdef WIN32 - if (!lua_isnil(L,param) && !lua_isuserdata(L,param)) - luaL_argerror(L, param, "data should be of type userdata"); + if (!lua_isnil(L,param) && + (!lua_isuserdata(L,param) || !lua_isstring(L, param))) + luaL_argerror(L, param, "data should be of type userdata or a string"); - return lua_touserdata(L,param); -#else - return (void *)luaL_checkstring(L,param); -#endif + if (lua_isuserdata(L,param)) + return lua_touserdata(L,param); + else + return (void *)luaL_checkstring(L,param); } static cdluaContext cdluanativewindowctx = |