commit b36b2a061c88be22e36900146cbcad39bab07f5d
parent ab52fc6097569cf51bc0c55dd5b6b1329eefd970
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 1 May 2002 17:40:20 -0300
new way to handle errors
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lua.h b/lua.h
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.127 2002/04/16 17:08:28 roberto Exp roberto $
+** $Id: lua.h,v 1.128 2002/04/22 14:40:23 roberto Exp roberto $
** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: info@lua.org
@@ -198,7 +198,7 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
** miscellaneous functions
*/
-LUA_API void lua_error (lua_State *L, const char *s);
+LUA_API void lua_errorobj (lua_State *L);
LUA_API int lua_next (lua_State *L, int index);
LUA_API int lua_getn (lua_State *L, int index);
@@ -215,6 +215,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size);
** ===============================================================
*/
+#define lua_error(L,s) (lua_pushstring(L, s), lua_errorobj(L))
+
#define lua_newpointerbox(L,u) \
(*(void **)(lua_newuserdata(L, sizeof(void *))) = (u))