diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_def.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/lj_def.h b/src/lj_def.h index 75aaeb79..af0687c4 100644 --- a/src/lj_def.h +++ b/src/lj_def.h | |||
@@ -337,14 +337,28 @@ static LJ_AINLINE uint32_t lj_getu32(const void *v) | |||
337 | #define LJ_FUNCA_NORET LJ_FUNCA LJ_NORET | 337 | #define LJ_FUNCA_NORET LJ_FUNCA LJ_NORET |
338 | #define LJ_ASMF_NORET LJ_ASMF LJ_NORET | 338 | #define LJ_ASMF_NORET LJ_ASMF LJ_NORET |
339 | 339 | ||
340 | /* Runtime assertions. */ | 340 | /* Internal assertions. */ |
341 | #ifdef lua_assert | 341 | #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) |
342 | #define check_exp(c, e) (lua_assert(c), (e)) | 342 | #define lj_assert_check(g, c, ...) \ |
343 | #define api_check(l, e) lua_assert(e) | 343 | ((c) ? (void)0 : \ |
344 | (lj_assert_fail((g), __FILE__, __LINE__, __func__, __VA_ARGS__), 0)) | ||
345 | #define lj_checkapi(c, ...) lj_assert_check(G(L), (c), __VA_ARGS__) | ||
344 | #else | 346 | #else |
345 | #define lua_assert(c) ((void)0) | 347 | #define lj_checkapi(c, ...) ((void)L) |
348 | #endif | ||
349 | |||
350 | #ifdef LUA_USE_ASSERT | ||
351 | #define lj_assertG_(g, c, ...) lj_assert_check((g), (c), __VA_ARGS__) | ||
352 | #define lj_assertG(c, ...) lj_assert_check(g, (c), __VA_ARGS__) | ||
353 | #define lj_assertL(c, ...) lj_assert_check(G(L), (c), __VA_ARGS__) | ||
354 | #define lj_assertX(c, ...) lj_assert_check(NULL, (c), __VA_ARGS__) | ||
355 | #define check_exp(c, e) (lj_assertX((c), #c), (e)) | ||
356 | #else | ||
357 | #define lj_assertG_(g, c, ...) ((void)0) | ||
358 | #define lj_assertG(c, ...) ((void)g) | ||
359 | #define lj_assertL(c, ...) ((void)L) | ||
360 | #define lj_assertX(c, ...) ((void)0) | ||
346 | #define check_exp(c, e) (e) | 361 | #define check_exp(c, e) (e) |
347 | #define api_check luai_apicheck | ||
348 | #endif | 362 | #endif |
349 | 363 | ||
350 | /* Static assertions. */ | 364 | /* Static assertions. */ |