Comparison

util-src/pposix.c @ 6789:6b180e77c97a

util-src/*.c: Invert Lua 5.2 compat to be 5.2+ by default and a macro to support 5.1
author Kim Alvefur <zash@zash.se>
date Sun, 26 Apr 2015 12:38:37 +0200
parent 6642:113d321976b6
child 6942:f12deb882148
comparison
equal deleted inserted replaced
6788:d64c1f3c7e2e 6789:6b180e77c97a
33 #include <errno.h> 33 #include <errno.h>
34 #include "lua.h" 34 #include "lua.h"
35 #include "lualib.h" 35 #include "lualib.h"
36 #include "lauxlib.h" 36 #include "lauxlib.h"
37 37
38 #if (LUA_VERSION_NUM == 502) 38 #if (LUA_VERSION_NUM == 501)
39 #define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) 39 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R)
40 #endif 40 #endif
41 41
42 #include <fcntl.h> 42 #include <fcntl.h>
43 #if defined(__linux__) && defined(_GNU_SOURCE) 43 #if defined(__linux__) && defined(_GNU_SOURCE)
44 #include <linux/falloc.h> 44 #include <linux/falloc.h>
801 801
802 { NULL, NULL } 802 { NULL, NULL }
803 }; 803 };
804 804
805 lua_newtable(L); 805 lua_newtable(L);
806 luaL_register(L, NULL, exports); 806 luaL_setfuncs(L, exports, 0);
807 807
808 lua_pushliteral(L, "pposix"); 808 lua_pushliteral(L, "pposix");
809 lua_setfield(L, -2, "_NAME"); 809 lua_setfield(L, -2, "_NAME");
810 810
811 lua_pushliteral(L, MODULE_VERSION); 811 lua_pushliteral(L, MODULE_VERSION);