From ace784b225237d1b59576847cd96e3cab9c70dbb Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sat, 26 Aug 2017 21:22:17 +1000 Subject: Have lua_pushstring return the pushed string Fixes #21 --- c-api/compat-5.3.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'c-api/compat-5.3.h') diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index 0083eb4..67e1da6 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h @@ -119,6 +119,9 @@ COMPAT53_API void lua_copy (lua_State *L, int from, int to); #define lua_len COMPAT53_CONCAT(COMPAT53_PREFIX, _len) COMPAT53_API void lua_len (lua_State *L, int i); +#define lua_pushstring(L, s) \ + (lua_pushstring(L, (s)), lua_tostring(L, -1)) + #ifndef luaL_newlibtable # define luaL_newlibtable(L, l) \ (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1)) -- cgit v1.2.3-55-g6feb