diff options
-rw-r--r-- | llimits.h | 5 | ||||
-rw-r--r-- | lobject.h | 7 |
2 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.87 2011/02/01 16:52:38 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.88 2011/02/28 17:32:10 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 | */ |
@@ -59,9 +59,12 @@ typedef LUAI_UACNUMBER l_uacNumber; | |||
59 | /* internal assertions for in-house debugging */ | 59 | /* internal assertions for in-house debugging */ |
60 | #if defined(lua_assert) | 60 | #if defined(lua_assert) |
61 | #define check_exp(c,e) (lua_assert(c), (e)) | 61 | #define check_exp(c,e) (lua_assert(c), (e)) |
62 | /* to avoid problems with conditions too long */ | ||
63 | #define lua_longassert(c) { if (!(c)) lua_assert(0); } | ||
62 | #else | 64 | #else |
63 | #define lua_assert(c) /* empty */ | 65 | #define lua_assert(c) /* empty */ |
64 | #define check_exp(c,e) (e) | 66 | #define check_exp(c,e) (e) |
67 | #define lua_longassert(c) /* empty */ | ||
65 | #endif | 68 | #endif |
66 | 69 | ||
67 | /* | 70 | /* |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.51 2011/05/04 17:04:06 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.52 2011/05/05 15:53:23 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -152,10 +152,9 @@ typedef struct lua_TValue { | |||
152 | /* Macros for internal tests */ | 152 | /* Macros for internal tests */ |
153 | #define righttt(obj) (ttype(obj) == gcvalue(obj)->gch.tt) | 153 | #define righttt(obj) (ttype(obj) == gcvalue(obj)->gch.tt) |
154 | 154 | ||
155 | #define checkconsistency(obj) lua_assert(!iscollectable(obj) || righttt(obj)) | ||
156 | |||
157 | #define checkliveness(g,obj) \ | 155 | #define checkliveness(g,obj) \ |
158 | lua_assert(!iscollectable(obj) || (righttt(obj) && !isdead(g,gcvalue(obj)))) | 156 | lua_longassert(!iscollectable(obj) || \ |
157 | (righttt(obj) && !isdead(g,gcvalue(obj)))) | ||
159 | 158 | ||
160 | 159 | ||
161 | /* Macros to set values */ | 160 | /* Macros to set values */ |