1
+ [ ![ Build Status] ( https://travis-ci.org/keplerproject/lua-compat-5.3.svg?branch=master )] ( https://travis-ci.org/keplerproject/lua-compat-5.3 )
2
+
1
3
# lua-compat-5.3
2
4
3
5
Lua-5.3-style APIs for Lua 5.2 and 5.1.
@@ -72,7 +74,11 @@ your project:
72
74
compatibility functions in your code. You have to compile and link
73
75
` compat-5.3.c ` to your project yourself. You can change the way the
74
76
functions are exported using the ` COMPAT53_API ` macro (e.g. if you need
75
- some ` __declspec ` magic).
77
+ some ` __declspec ` magic). While it is technically possible to use
78
+ the "lua" prefix (and it looks better in the debugger), this is
79
+ discouraged because LuaJIT has started to implement its own Lua 5.2+
80
+ C API functions, and with the "lua" prefix you'd violate the
81
+ one-definition rule with recent LuaJIT versions.
76
82
77
83
## What's implemented
78
84
@@ -129,6 +135,7 @@ For Lua 5.1 additionally:
129
135
* ` lua_isinteger `
130
136
* ` lua_numbertointeger `
131
137
* ` lua_callk ` and ` lua_pcallk ` (limited compatibility, see [ here] [ 14 ] )
138
+ * ` lua_resume `
132
139
* ` lua_rawget ` and ` lua_rawgeti ` (return values)
133
140
* ` lua_rawgetp ` and ` lua_rawsetp `
134
141
* ` luaL_requiref ` (now checks ` package.loaded ` first)
@@ -137,12 +144,17 @@ For Lua 5.1 additionally:
137
144
138
145
For Lua 5.1 additionally:
139
146
* ` LUA_OK `
147
+ * ` LUA_ERRGCMM `
140
148
* ` LUA_OP* ` macros for ` lua_arith ` and ` lua_compare `
149
+ * ` LUA_FILEHANDLE `
141
150
* ` lua_Unsigned `
151
+ * ` luaL_Stream ` (limited compatibility, see [ here] [ 19 ] )
142
152
* ` lua_absindex `
143
- * ` lua_arith ` (see [ here] [ 19 ] )
153
+ * ` lua_arith ` (see [ here] [ 20 ] )
144
154
* ` lua_compare `
145
155
* ` lua_len ` , ` lua_rawlen ` , and ` luaL_len `
156
+ * ` lua_load ` (mode argument)
157
+ * ` lua_pushstring ` , ` lua_pushlstring ` (return value)
146
158
* ` lua_copy `
147
159
* ` lua_pushglobaltable `
148
160
* ` luaL_testudata `
@@ -152,11 +164,13 @@ For Lua 5.1 additionally:
152
164
* ` luaL_traceback `
153
165
* ` luaL_execresult `
154
166
* ` luaL_fileresult `
167
+ * ` luaL_loadbufferx `
168
+ * ` luaL_loadfilex `
155
169
* ` luaL_checkversion ` (with empty body, only to avoid compile errors,
156
- see [ here] [ 20 ] )
170
+ see [ here] [ 21 ] )
157
171
* ` luaL_tolstring `
158
172
* ` luaL_buffinitsize ` , ` luaL_prepbuffsize ` , and ` luaL_pushresultsize `
159
- (see [ here] [ 21 ] )
173
+ (see [ here] [ 22 ] )
160
174
* ` lua_pushunsigned ` , ` lua_tounsignedx ` , ` lua_tounsigned ` ,
161
175
` luaL_checkunsigned ` , ` luaL_optunsigned ` , if
162
176
` LUA_COMPAT_APIINTCASTS ` is defined.
@@ -179,8 +193,6 @@ For Lua 5.1 additionally:
179
193
* ` lua_upvaluejoin ` (5.1)
180
194
* ` lua_version ` (5.1)
181
195
* ` lua_yieldk ` (5.1)
182
- * ` luaL_loadbufferx ` (5.1)
183
- * ` luaL_loadfilex ` (5.1)
184
196
185
197
## See also
186
198
@@ -197,6 +209,8 @@ This package contains code written by:
197
209
* Tomás Guisasola Gorham ([ @tomasguisasola ] ( http://github.com/tomasguisasola ) )
198
210
* Hisham Muhammad ([ @hishamhm ] ( http://github.com/hishamhm ) )
199
211
* Renato Maia ([ @renatomaia ] ( http://github.com/renatomaia ) )
212
+ * [ @ThePhD ] ( http://github.com/ThePhD )
213
+ * [ @Daurnimator ] ( http://github.com/Daurnimator )
200
214
201
215
202
216
[ 1 ] : http://www.inf.puc-rio.br/~roberto/struct/
@@ -217,8 +231,9 @@ This package contains code written by:
217
231
[ 16 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/lua_getuservalue
218
232
[ 17 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/lua_setuservalue
219
233
[ 18 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/lua_stringtonumber
220
- [ 19 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/lua_arith
221
- [ 20 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_checkversion
222
- [ 21 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_Buffer
223
- [ 22 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/coroutine.running
234
+ [ 19 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_Stream
235
+ [ 20 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/lua_arith
236
+ [ 21 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_checkversion
237
+ [ 22 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_Buffer
238
+ [ 23 ] : https://github.com/keplerproject/lua-compat-5.3/wiki/coroutine.running
224
239
0 commit comments