diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-09 19:51:06 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-09 19:51:06 -0200 |
commit | ea2a75d19e260ad728d0b804d824c619bf2218d0 (patch) | |
tree | 6d747b4380fe6e2673ffec7ed28b90b68c59f713 /ltests.h | |
parent | b3bb0f132b2a3dba88385f8d71ba3f34252d94e4 (diff) | |
download | lua-ea2a75d19e260ad728d0b804d824c619bf2218d0.tar.gz lua-ea2a75d19e260ad728d0b804d824c619bf2218d0.tar.bz2 lua-ea2a75d19e260ad728d0b804d824c619bf2218d0.zip |
new macro lua_userstateopen
Diffstat (limited to 'ltests.h')
-rw-r--r-- | ltests.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.h,v 1.8 2001/08/31 19:46:07 roberto Exp $ | 2 | ** $Id: ltests.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ |
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 | */ |
@@ -41,8 +41,9 @@ void *debug_realloc (void *block, size_t oldsize, size_t size); | |||
41 | 41 | ||
42 | 42 | ||
43 | /* test for lock/unlock */ | 43 | /* test for lock/unlock */ |
44 | #define LUA_USERSTATE int *lock; | ||
45 | extern int islocked; | 44 | extern int islocked; |
45 | #define LUA_USERSTATE int *lock; | ||
46 | #define lua_userstateopen(l) if (l != NULL) *cast(int **, l) = &islocked; | ||
46 | #define lua_lock(L) lua_assert((**cast(int **, L))++ == 0) | 47 | #define lua_lock(L) lua_assert((**cast(int **, L))++ == 0) |
47 | #define lua_unlock(L) lua_assert(--(**cast(int **, L)) == 0) | 48 | #define lua_unlock(L) lua_assert(--(**cast(int **, L)) == 0) |
48 | 49 | ||