macro 'luai_apicheck'/'api_check' back with a 'lua_State' parameter

(some people use it)
This commit is contained in:
Roberto Ierusalimschy
2015-03-06 16:49:50 -03:00
parent bb4baa73ea
commit a30c66f0fc
6 changed files with 60 additions and 54 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: llimits.h,v 1.132 2015/03/03 19:53:13 roberto Exp roberto $
** $Id: llimits.h,v 1.133 2015/03/04 13:31:21 roberto Exp roberto $
** Limits, basic types, and some other 'installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -88,15 +88,11 @@ typedef LUAI_UACINT l_uacInt;
/*
** assertion for checking API calls
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(e) assert(e)
#else
#define luai_apicheck(e) lua_assert(e)
#if !defined(luai_apicheck)
#define luai_apicheck(l,e) lua_assert(e)
#endif
#define api_check(e,msg) luai_apicheck((e) && msg)
#define api_check(l,e,msg) luai_apicheck(l,(e) && msg)
/* macro to avoid warnings about unused variables */