Comparison

util-src/table.c @ 7818:54669df178c2

util-src: Make C modules assert that the Lua runtime matches what it was compiled for
author Kim Alvefur <zash@zash.se>
date Sun, 08 Jan 2017 14:21:08 +0100
parent 7538:a3a4ed0d34f4
child 7835:a809dcfd0c5b
comparison
equal deleted inserted replaced
7816:2624f4ee34a2 7818:54669df178c2
19 return 1; 19 return 1;
20 } 20 }
21 21
22 22
23 int luaopen_util_table(lua_State* L) { 23 int luaopen_util_table(lua_State* L) {
24 #if (LUA_VERSION_NUM > 501)
25 luaL_checkversion(L);
26 #endif
24 lua_newtable(L); 27 lua_newtable(L);
25 lua_pushcfunction(L, Lcreate_table); 28 lua_pushcfunction(L, Lcreate_table);
26 lua_setfield(L, -2, "create"); 29 lua_setfield(L, -2, "create");
27 lua_pushcfunction(L, Lpack); 30 lua_pushcfunction(L, Lpack);
28 lua_setfield(L, -2, "pack"); 31 lua_setfield(L, -2, "pack");