From 7320d58358de2d981135e7d8ef03eaed665bb2bc Mon Sep 17 00:00:00 2001 From: ThePhD Date: Wed, 13 Sep 2017 00:44:25 -0400 Subject: define LUA_ERRGCMM code for return values --- c-api/compat-5.3.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'c-api') diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index 3d20d21..6c76930 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h @@ -88,6 +88,19 @@ extern "C" { # define LUA_OPLE 2 #endif +/* LuaJIT/Lua 5.1 does not have the updated + * error codes for thread status/function returns (but some patched versions do) + * define it only if it's not found + */ +#if !defined(LUA_ERRGCMM) +/* Use + 2 because in some versions of Lua (Lua 5.1) + * LUA_ERRFILE is defined as (LUA_ERRERR+1) + * so we need to avoid it (LuaJIT might have something at this + * integer value too) + */ +# define LUA_ERRGCMM (LUA_ERRERR + 2) +#endif /* LUA_ERRGCMM define */ + typedef size_t lua_Unsigned; typedef struct luaL_Buffer_53 { -- cgit v1.2.3-55-g6feb