diff --git a/include/llimits.h b/include/llimits.h index 561662c..fc10296 100644 --- a/include/llimits.h +++ b/include/llimits.h @@ -72,14 +72,15 @@ typedef union { double u; void *s; lua_Integer i; long l; } L_Umaxalign; typedef LUAI_UACNUMBER l_uacNumber; typedef LUAI_UACINT l_uacInt; -#if !defined(NDEBUG) && !defined(lua_assert) -#include -#define lua_assert assert -#endif /* internal assertions for in-house debugging */ #if defined(lua_assert) -#warning lua_assert has been defined +#if !defined(RAVI_OPTION_STRING1) +#define RAVI_OPTION_STRING1 " assertions" +#endif +#if !defined(RAVI_OPTION_STRING2) +#define RAVI_OPTION_STRING2 +#endif #define check_exp(c,e) (lua_assert(c), (e)) /* to avoid problems with conditions too long */ #define lua_longassert(c) { if (!(c)) lua_assert(0); } @@ -87,6 +88,8 @@ typedef LUAI_UACINT l_uacInt; #define lua_assert(c) ((void)0) #define check_exp(c,e) (e) #define lua_longassert(c) ((void)0) +#define RAVI_OPTION_STRING1 +#define RAVI_OPTION_STRING2 #endif /* diff --git a/include/ltests.h b/include/ltests.h index 5676f12..517516b 100644 --- a/include/ltests.h +++ b/include/ltests.h @@ -33,6 +33,12 @@ #define lua_assert(c) assert(c) +#if !defined(RAVI_OPTION_STRING1) +#define RAVI_OPTION_STRING1 " assertions" +#endif + +#define RAVI_OPTION_STRING2 " ltests" + /* to avoid warnings, and to make sure value is really unused */ #define UNUSED(x) (x=0, (void)(x)) diff --git a/include/lualib.h b/include/lualib.h index 7fc7ab5..8ac67ca 100644 --- a/include/lualib.h +++ b/include/lualib.h @@ -59,6 +59,8 @@ LUALIB_API void (luaL_openlibs) (lua_State *L); #if !defined(lua_assert) #define lua_assert(x) ((void)0) +#define RAVI_OPTION_STRING1 +#define RAVI_OPTION_STRING2 #endif diff --git a/src/lua.c b/src/lua.c index ee79946..9960cd4 100644 --- a/src/lua.c +++ b/src/lua.c @@ -40,6 +40,15 @@ #define LUA_INITVARVERSION \ LUA_INIT_VAR "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR +#ifdef USE_LLVM +#define RAVI_OPTION_STRING3 " LLVM" +#elif USE_GCCJIT +#define RAVI_OPTION_STRING3 " gccjit" +#else +#define RAVI_OPTION_STRING3 " nojit" +#endif + +#define RAVI_OPTIONS "\nOptions" RAVI_OPTION_STRING1 RAVI_OPTION_STRING2 RAVI_OPTION_STRING3 /* ** lua_stdin_is_tty detects whether the standard input is a 'tty' (that @@ -207,6 +216,7 @@ static int docall (lua_State *L, int narg, int nres) { static void print_version (void) { lua_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); + lua_writestring(RAVI_OPTIONS, strlen(RAVI_OPTIONS)); lua_writeline(); } diff --git a/src/lvm.c b/src/lvm.c index f4fe367..706a23e 100644 --- a/src/lvm.c +++ b/src/lvm.c @@ -910,7 +910,6 @@ newframe: /* reentry point when frame changes (call/return) */ */ } break; case OP_GETTABLE: { - l_gettable: Protect(luaV_gettable(L, RB(i), RKC(i), ra)); } break; case OP_SETTABUP: {