diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2017-08-27 10:18:13 +0200 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2017-08-27 10:18:13 +0200 |
commit | 8b399a1c21ec80b405f1aadeac01d7230922f3b0 (patch) | |
tree | d11498b47e25ebf2b0c9ffddd5f7c25bedc097a1 /c-api | |
parent | 7ceb999157d71e29c93c4b2b83ba9c3c46191191 (diff) | |
parent | 67aabb83a1eeea860b1a9a2104c90b80a523268a (diff) | |
download | lua-compat-5.3-8b399a1c21ec80b405f1aadeac01d7230922f3b0.tar.gz lua-compat-5.3-8b399a1c21ec80b405f1aadeac01d7230922f3b0.tar.bz2 lua-compat-5.3-8b399a1c21ec80b405f1aadeac01d7230922f3b0.zip |
Merge branch 'daurnimator-pushstring-return'
Diffstat (limited to 'c-api')
-rw-r--r-- | c-api/compat-5.3.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index 0083eb4..7dd77c6 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h | |||
@@ -119,6 +119,12 @@ 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 | |||
125 | #define lua_pushlstring(L, s, len) \ | ||
126 | ((((len) == 0) ? lua_pushlstring(L, "", 0) : lua_pushlstring(L, (s), (len))), lua_tostring(L, -1)) | ||
127 | |||
122 | #ifndef luaL_newlibtable | 128 | #ifndef luaL_newlibtable |
123 | # define luaL_newlibtable(L, l) \ | 129 | # define luaL_newlibtable(L, l) \ |
124 | (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1)) | 130 | (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1)) |