From 0969a971cd41921bd5ee72c1da880455bcca3bb4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 9 Mar 1998 18:49:52 -0300 Subject: better use of "ASSERT". --- lobject.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 9177f03c..d2abaa1b 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.16 1998/01/19 19:49:22 roberto Exp roberto $ +** $Id: lobject.h,v 1.17 1998/03/06 16:54:42 roberto Exp $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -13,6 +13,17 @@ #include "lua.h" +#ifdef DEBUG +#include "lauxlib.h" +#define LUA_INTERNALERROR(s) \ + luaL_verror("INTERNAL ERROR - %s [%s:%d]",(s),__FILE__,__LINE__) +#define LUA_ASSERT(c,s) { if (!(c)) LUA_INTERNALERROR(s); } +#else +#define LUA_INTERNALERROR(s) /* empty */ +#define LUA_ASSERT(c,s) /* empty */ +#endif + + /* ** "real" is the type "number" of Lua ** GREP LUA_NUMBER to change that -- cgit v1.2.3-55-g6feb