lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I think you meant that "#define lua_assert(x) assert(x)" is all I need?

Just defining LUA_USE_APICHECK does not change lua_assert() at all, and if I only define LUA_USE_APICHECK then lua_assert(0) does not cause an assertion. However, if I remove the LUA_USE_APICHECK define but do define lua_assert() then luai_apicheck() will also assert. :)

I have removed the LUA_USE_APICHECK define from my luaconf.h as just defining lua_assert() does the trick, thanks for brining that to my attention! I probably defined LUA_USE_APICHECK at one point, then enabled lua_assert() and didn't realise I could remove the api check define!

~pmd~



On Nov 12, 2013, at 6:44 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:

>> I have been hacking away at Lua for the past few weeks and have enabled asserts with the following code at the top of luaconf.h:
>> 
>> #include <assert.h>
>> #define lua_assert(x)  assert(x)
>> #define LUA_USE_APICHECK
> 
> #define LUA_USE_APICHECK should suffice. See llimits.h.
>