Skip to content

Commit

Permalink
lua 5.3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Feb 3, 2016
1 parent 0ac7fdf commit 9455147
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions File.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "general.h"
#include "THFile.h"
#include "luaT.h"

Expand Down
10 changes: 10 additions & 0 deletions general.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@

#endif

#if LUA_VERSION_NUM >= 503
/* one can simply enable LUA_COMPAT_5_2 to be backward compatible.
However, this does not work when we are trying to use system-installed lua,
hence these redefines
*/
#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#endif

#endif

0 comments on commit 9455147

Please sign in to comment.