better use of "ASSERT".

This commit is contained in:
Roberto Ierusalimschy
1998-03-09 18:49:52 -03:00
parent be6d215f67
commit 0969a971cd
9 changed files with 34 additions and 19 deletions

View File

@@ -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