aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-06-13 10:45:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-06-13 10:45:31 -0300
commit8fd0f6a82b63f4a2f77578fb70c9fe46047f295b (patch)
tree0ef4abdeaf45e1906c3c61c809b79a34872f68b5
parenteb3de8768a6b614597f7e5f018fc31a9f52441df (diff)
downloadlua-8fd0f6a82b63f4a2f77578fb70c9fe46047f295b.tar.gz
lua-8fd0f6a82b63f4a2f77578fb70c9fe46047f295b.tar.bz2
lua-8fd0f6a82b63f4a2f77578fb70c9fe46047f295b.zip
new macro to check conditions on expression macros
-rw-r--r--llimits.h7
-rw-r--r--ltests.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/llimits.h b/llimits.h
index dd0b978b..bc686a4f 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.42 2002/03/26 20:46:10 roberto Exp roberto $ 2** $Id: llimits.h,v 1.43 2002/04/23 14:59:35 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*/
@@ -83,6 +83,11 @@ union L_Umaxalign { LUSER_ALIGNMENT_T u; void *s; long l; };
83#endif 83#endif
84 84
85 85
86#ifndef check_exp
87#define check_exp(c,e) (e)
88#endif
89
90
86#ifndef UNUSED 91#ifndef UNUSED
87#define UNUSED(x) ((void)(x)) /* to avoid warnings */ 92#define UNUSED(x) ((void)(x)) /* to avoid warnings */
88#endif 93#endif
diff --git a/ltests.h b/ltests.h
index 6aef3984..9a03d27a 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 1.12 2002/03/08 19:17:59 roberto Exp roberto $ 2** $Id: ltests.h,v 1.13 2002/06/11 16:26:12 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*/
@@ -18,6 +18,7 @@
18#undef NDEBUG 18#undef NDEBUG
19#include <assert.h> 19#include <assert.h>
20#define lua_assert(c) assert(c) 20#define lua_assert(c) assert(c)
21#define check_exp(c,e) (lua_assert(c), (e))
21#define api_check(L, o) lua_assert(o) 22#define api_check(L, o) lua_assert(o)
22 23
23 24