summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-12-27 15:12:00 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-12-27 15:12:00 -0200
commit0fd64669579f33b03dcda6fac4be908b4cfd7e15 (patch)
tree0d5221b01266c46731ace42ea1db72460e3e28bd
parent6a516878e93fb46795aac95087aaf34b17cc4930 (diff)
downloadlua-0fd64669579f33b03dcda6fac4be908b4cfd7e15.tar.gz
lua-0fd64669579f33b03dcda6fac4be908b4cfd7e15.tar.bz2
lua-0fd64669579f33b03dcda6fac4be908b4cfd7e15.zip
lua_assert is an internal matter, not to be configured
-rw-r--r--llimits.h19
-rw-r--r--ltests.h3
-rw-r--r--luaconf.h12
-rw-r--r--lualib.h8
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 @@
1/* 1/*
2** $Id: llimits.h,v 1.67 2005/08/24 16:15:49 roberto Exp roberto $ 2** $Id: llimits.h,v 1.68 2005/12/22 16:19:56 roberto Exp roberto $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -15,9 +15,6 @@
15#include "lua.h" 15#include "lua.h"
16 16
17 17
18#define api_check luai_apicheck
19
20
21typedef LUAI_UINT32 lu_int32; 18typedef LUAI_UINT32 lu_int32;
22 19
23typedef LUAI_UMEM lu_mem; 20typedef LUAI_UMEM lu_mem;
@@ -54,7 +51,19 @@ typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
54typedef LUAI_UACNUMBER l_uacNumber; 51typedef LUAI_UACNUMBER l_uacNumber;
55 52
56 53
57#define check_exp(c,e) (lua_assert(c), (e)) 54/* internal assertions for in-house debugging */
55#ifdef lua_assert
56
57#define check_exp(c,e) (lua_assert(c), (e))
58#define api_check(l,e) lua_assert(e)
59
60#else
61
62#define lua_assert(c) ((void)0)
63#define check_exp(c,e) (e)
64#define api_check luai_apicheck
65
66#endif
58 67
59 68
60#ifndef UNUSED 69#ifndef UNUSED
diff --git a/ltests.h b/ltests.h
index 1d054bae..bedf8570 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 2.15 2005/06/06 13:30:25 roberto Exp roberto $ 2** $Id: ltests.h,v 2.16 2005/09/14 17:48:57 roberto Exp roberto $
3** Internal Header for Debugging of the Lua Implementation 3** Internal Header for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -15,7 +15,6 @@
15 15
16#undef NDEBUG 16#undef NDEBUG
17#include <assert.h> 17#include <assert.h>
18#undef lua_assert
19#define lua_assert(c) assert(c) 18#define lua_assert(c) assert(c)
20 19
21 20
diff --git a/luaconf.h b/luaconf.h
index a0504e0f..d4d93974 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.75 2005/11/25 13:29:11 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.76 2005/12/15 18:53:34 roberto Exp roberto $
3** Configuration file for Lua 3** Configuration file for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -183,13 +183,6 @@
183 183
184 184
185/* 185/*
186@@ lua_assert describes the internal assertions in Lua.
187** CHANGE that only if you need to debug Lua.
188*/
189#define lua_assert(c) ((void)0)
190
191
192/*
193@@ LUA_QL describes how error messages quote program elements. 186@@ LUA_QL describes how error messages quote program elements.
194** CHANGE it if you want a different appearance. 187** CHANGE it if you want a different appearance.
195*/ 188*/
@@ -373,8 +366,7 @@
373#include <assert.h> 366#include <assert.h>
374#define luai_apicheck(L,o) { (void)L; assert(o); } 367#define luai_apicheck(L,o) { (void)L; assert(o); }
375#else 368#else
376/* (By default lua_assert is empty, so luai_apicheck is also empty.) */ 369#define luai_apicheck(L,o) { (void)L; }
377#define luai_apicheck(L,o) { (void)L; lua_assert(o); }
378#endif 370#endif
379 371
380 372
diff --git a/lualib.h b/lualib.h
index 26c1827d..3afa4591 100644
--- a/lualib.h
+++ b/lualib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lualib.h,v 1.34 2005/04/13 17:24:20 roberto Exp roberto $ 2** $Id: lualib.h,v 1.35 2005/08/10 18:06:58 roberto Exp roberto $
3** Lua standard libraries 3** Lua standard libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -44,4 +44,10 @@ LUALIB_API int (luaopen_package) (lua_State *L);
44LUALIB_API void (luaL_openlibs) (lua_State *L); 44LUALIB_API void (luaL_openlibs) (lua_State *L);
45 45
46 46
47
48#ifndef lua_assert
49#define lua_assert(x) ((void)0)
50#endif
51
52
47#endif 53#endif