diff options
author | daurnimator <quae@daurnimator.com> | 2017-08-26 21:22:17 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-08-26 21:40:27 +1000 |
commit | ace784b225237d1b59576847cd96e3cab9c70dbb (patch) | |
tree | 64c0b6399c48ee2a6147b586a057c11a05a2d603 /c-api/compat-5.3.h | |
parent | 7ceb999157d71e29c93c4b2b83ba9c3c46191191 (diff) | |
download | lua-compat-5.3-ace784b225237d1b59576847cd96e3cab9c70dbb.tar.gz lua-compat-5.3-ace784b225237d1b59576847cd96e3cab9c70dbb.tar.bz2 lua-compat-5.3-ace784b225237d1b59576847cd96e3cab9c70dbb.zip |
Have lua_pushstring return the pushed string
Fixes #21
Diffstat (limited to 'c-api/compat-5.3.h')
-rw-r--r-- | c-api/compat-5.3.h | 3 |
1 files changed, 3 insertions, 0 deletions
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); | |||
119 | #define lua_len COMPAT53_CONCAT(COMPAT53_PREFIX, _len) | 119 | #define lua_len COMPAT53_CONCAT(COMPAT53_PREFIX, _len) |
120 | COMPAT53_API void lua_len (lua_State *L, int i); | 120 | COMPAT53_API void lua_len (lua_State *L, int i); |
121 | 121 | ||
122 | #define lua_pushstring(L, s) \ | ||
123 | (lua_pushstring(L, (s)), lua_tostring(L, -1)) | ||
124 | |||
122 | #ifndef luaL_newlibtable | 125 | #ifndef luaL_newlibtable |
123 | # define luaL_newlibtable(L, l) \ | 126 | # define luaL_newlibtable(L, l) \ |
124 | (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1)) | 127 | (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1)) |