From 419494337e30fa3fa539990e8ae7c314ce01eaab Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 27 Feb 2017 15:25:10 +1100 Subject: Add lua_getfield compatibility macro that returns the type (as it does in 5.3) --- src/compat52.h | 8 ++++++++ src/openssl.c | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compat52.h b/src/compat52.h index 0057b3c..22541f7 100644 --- a/src/compat52.h +++ b/src/compat52.h @@ -23,6 +23,14 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * ========================================================================== */ + + +#if LUA_VERSION_NUM < 503 + +#define lua_getfield(L, i, f) (lua_getfield(L, (i), (f)), lua_type(L, -1)) + +#endif + #if LUA_VERSION_NUM < 502 #define LUA_OK 0 diff --git a/src/openssl.c b/src/openssl.c index 9ea9469..1307852 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -74,9 +74,7 @@ #include #include -#if LUA_VERSION_NUM < 502 #include "compat52.h" -#endif #define GNUC_2VER(M, m, p) (((M) * 10000) + ((m) * 100) + (p)) #define GNUC_PREREQ(M, m, p) (__GNUC__ > 0 && GNUC_2VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) >= GNUC_2VER((M), (m), (p))) -- cgit v1.2.3-59-g8ed1b