Skip to content

Commit

Permalink
fix lua5.1 version
Browse files Browse the repository at this point in the history
  • Loading branch information
aikin-vip committed Apr 6, 2022
1 parent 7c42694 commit 1a4bb16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nanoid.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

#include "nanoid.h"

#if LUA_VERSION_NUM < 502
#define luaL_newlib(L, l) (lua_newtable(L), luaL_register(L, NULL, l))
#endif

static int l_generate( lua_State *L )
{
lua_Integer n = lua_tointeger(L, 1);
Expand Down

0 comments on commit 1a4bb16

Please sign in to comment.