diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-05-05 16:43:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-05-05 16:43:14 -0300 |
commit | 3cf1729a0219b8b461e171dc88ece36530596c74 (patch) | |
tree | 3dd5a83c2739406b69a95675065205831f3130f5 /llimits.h | |
parent | 74b0bb3a458adc8e0d845d67e0f9486679466d26 (diff) | |
download | lua-3cf1729a0219b8b461e171dc88ece36530596c74.tar.gz lua-3cf1729a0219b8b461e171dc88ece36530596c74.tar.bz2 lua-3cf1729a0219b8b461e171dc88ece36530596c74.zip |
new macro 'lua_longassert' that is equivalent to an assertion without
a stringfication of the condition, to avoid too long string literals
(limited by C90 to ~510 characters)
Diffstat (limited to 'llimits.h')
-rw-r--r-- | llimits.h | 5 |
1 files changed, 4 insertions, 1 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 | /* |