Skip to content

Commit e7a3e28

Browse files
committed
Declare lua_assert macro for lua 5.5
This is required by liolib.c, lstrllib.c, and ltablib.c, but was removed from the lua 5.5 since it was never a public part of the api.
1 parent 5fd829e commit e7a3e28

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

c-api/compat-5.3.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,26 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname,
395395

396396

397397

398+
/* declarations for Lua 5.5 */
399+
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 505
400+
401+
/*
402+
** Internal assertions for in-house debugging
403+
*/
404+
#if defined LUAI_ASSERT
405+
# undef NDEBUG
406+
# include <assert.h>
407+
# define lua_assert(c) assert(c)
408+
#endif
409+
410+
#if !defined(lua_assert)
411+
# define lua_assert(c) ((void)0)
412+
#endif
413+
414+
#endif /* Lua 5.5 only */
415+
416+
417+
398418
/* other Lua versions */
399419
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 505
400420

0 commit comments

Comments
 (0)