Comparison

util-src/signal.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 6620:50eaefeec013
child 7818:54669df178c2
comparison
equal deleted inserted replaced
6788:d64c1f3c7e2e 6789:6b180e77c97a
30 #include <stdlib.h> 30 #include <stdlib.h>
31 31
32 #include "lua.h" 32 #include "lua.h"
33 #include "lauxlib.h" 33 #include "lauxlib.h"
34 34
35 #if (LUA_VERSION_NUM == 502) 35 #if (LUA_VERSION_NUM == 501)
36 #define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) 36 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R)
37 #endif 37 #endif
38 38
39 #ifndef lsig 39 #ifndef lsig
40 40
41 #define lsig 41 #define lsig
386 int luaopen_util_signal(lua_State* L) { 386 int luaopen_util_signal(lua_State* L) {
387 int i = 0; 387 int i = 0;
388 388
389 /* add the library */ 389 /* add the library */
390 lua_newtable(L); 390 lua_newtable(L);
391 luaL_register(L, NULL, lsignal_lib); 391 luaL_setfuncs(L, lsignal_lib, 0);
392 392
393 /* push lua_signals table into the registry */ 393 /* push lua_signals table into the registry */
394 /* put the signals inside the library table too, 394 /* put the signals inside the library table too,
395 * they are only a reference */ 395 * they are only a reference */
396 lua_pushstring(L, LUA_SIGNAL); 396 lua_pushstring(L, LUA_SIGNAL);