Software /
code /
prosody
Comparison
util-src/signal.c @ 12575:1f6f05a98fcd
util-src: Remove Lua 5.1 compat macros
Part of #1600
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 01 Jul 2022 21:21:21 +0200 |
parent | 10799:763bb2ce3f60 |
child | 12976:a187600ec7d6 |
comparison
equal
deleted
inserted
replaced
12574:18d33668c5fa | 12575:1f6f05a98fcd |
---|---|
34 #include <stdlib.h> | 34 #include <stdlib.h> |
35 | 35 |
36 #include "lua.h" | 36 #include "lua.h" |
37 #include "lauxlib.h" | 37 #include "lauxlib.h" |
38 | 38 |
39 #if (LUA_VERSION_NUM == 501) | |
40 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R) | |
41 #endif | |
42 #if (LUA_VERSION_NUM < 503) | 39 #if (LUA_VERSION_NUM < 503) |
43 #define lua_isinteger(L, n) lua_isnumber(L, n) | 40 #define lua_isinteger(L, n) lua_isnumber(L, n) |
44 #endif | 41 #endif |
45 | 42 |
46 #ifndef lsig | 43 #ifndef lsig |
379 #endif | 376 #endif |
380 {NULL, NULL} | 377 {NULL, NULL} |
381 }; | 378 }; |
382 | 379 |
383 int luaopen_util_signal(lua_State *L) { | 380 int luaopen_util_signal(lua_State *L) { |
384 #if (LUA_VERSION_NUM > 501) | |
385 luaL_checkversion(L); | 381 luaL_checkversion(L); |
386 #endif | |
387 int i = 0; | 382 int i = 0; |
388 | 383 |
389 /* add the library */ | 384 /* add the library */ |
390 lua_newtable(L); | 385 lua_newtable(L); |
391 luaL_setfuncs(L, lsignal_lib, 0); | 386 luaL_setfuncs(L, lsignal_lib, 0); |