From 0fd64669579f33b03dcda6fac4be908b4cfd7e15 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 27 Dec 2005 15:12:00 -0200 Subject: lua_assert is an internal matter, not to be configured --- llimits.h | 19 ++++++++++++++----- ltests.h | 3 +-- luaconf.h | 12 ++---------- lualib.h | 8 +++++++- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/llimits.h b/llimits.h index fce32902..e0065649 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.67 2005/08/24 16:15:49 roberto Exp roberto $ +** $Id: llimits.h,v 1.68 2005/12/22 16:19:56 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -15,9 +15,6 @@ #include "lua.h" -#define api_check luai_apicheck - - typedef LUAI_UINT32 lu_int32; typedef LUAI_UMEM lu_mem; @@ -54,7 +51,19 @@ typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; typedef LUAI_UACNUMBER l_uacNumber; -#define check_exp(c,e) (lua_assert(c), (e)) +/* internal assertions for in-house debugging */ +#ifdef lua_assert + +#define check_exp(c,e) (lua_assert(c), (e)) +#define api_check(l,e) lua_assert(e) + +#else + +#define lua_assert(c) ((void)0) +#define check_exp(c,e) (e) +#define api_check luai_apicheck + +#endif #ifndef UNUSED diff --git a/ltests.h b/ltests.h index 1d054bae..bedf8570 100644 --- a/ltests.h +++ b/ltests.h @@ -1,5 +1,5 @@ /* -** $Id: ltests.h,v 2.15 2005/06/06 13:30:25 roberto Exp roberto $ +** $Id: ltests.h,v 2.16 2005/09/14 17:48:57 roberto Exp roberto $ ** Internal Header for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -15,7 +15,6 @@ #undef NDEBUG #include -#undef lua_assert #define lua_assert(c) assert(c) diff --git a/luaconf.h b/luaconf.h index a0504e0f..d4d93974 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.75 2005/11/25 13:29:11 roberto Exp roberto $ +** $Id: luaconf.h,v 1.76 2005/12/15 18:53:34 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -182,13 +182,6 @@ -/* -@@ lua_assert describes the internal assertions in Lua. -** CHANGE that only if you need to debug Lua. -*/ -#define lua_assert(c) ((void)0) - - /* @@ LUA_QL describes how error messages quote program elements. ** CHANGE it if you want a different appearance. @@ -373,8 +366,7 @@ #include #define luai_apicheck(L,o) { (void)L; assert(o); } #else -/* (By default lua_assert is empty, so luai_apicheck is also empty.) */ -#define luai_apicheck(L,o) { (void)L; lua_assert(o); } +#define luai_apicheck(L,o) { (void)L; } #endif diff --git a/lualib.h b/lualib.h index 26c1827d..3afa4591 100644 --- a/lualib.h +++ b/lualib.h @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.34 2005/04/13 17:24:20 roberto Exp roberto $ +** $Id: lualib.h,v 1.35 2005/08/10 18:06:58 roberto Exp roberto $ ** Lua standard libraries ** See Copyright Notice in lua.h */ @@ -44,4 +44,10 @@ LUALIB_API int (luaopen_package) (lua_State *L); LUALIB_API void (luaL_openlibs) (lua_State *L); + +#ifndef lua_assert +#define lua_assert(x) ((void)0) +#endif + + #endif -- cgit v1.2.3-55-g6feb