Software /
code /
prosody
Comparison
util-src/poll.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 | 12316:6bb2f660f689 |
child | 12884:f5a75aaa8a25 |
comparison
equal
deleted
inserted
replaced
12574:18d33668c5fa | 12575:1f6f05a98fcd |
---|---|
42 #include <lualib.h> | 42 #include <lualib.h> |
43 #include <lauxlib.h> | 43 #include <lauxlib.h> |
44 | 44 |
45 #define STATE_MT "util.poll<" POLL_BACKEND ">" | 45 #define STATE_MT "util.poll<" POLL_BACKEND ">" |
46 | 46 |
47 #if (LUA_VERSION_NUM == 501) | |
48 #define luaL_setmetatable(L, tname) luaL_getmetatable(L, tname); lua_setmetatable(L, -2) | |
49 #endif | |
50 #if (LUA_VERSION_NUM < 504) | 47 #if (LUA_VERSION_NUM < 504) |
51 #define luaL_pushfail lua_pushnil | 48 #define luaL_pushfail lua_pushnil |
52 #endif | 49 #endif |
53 | 50 |
54 /* | 51 /* |
562 | 559 |
563 /* | 560 /* |
564 * Open library | 561 * Open library |
565 */ | 562 */ |
566 int luaopen_util_poll(lua_State *L) { | 563 int luaopen_util_poll(lua_State *L) { |
567 #if (LUA_VERSION_NUM > 501) | |
568 luaL_checkversion(L); | 564 luaL_checkversion(L); |
569 #endif | |
570 | 565 |
571 luaL_newmetatable(L, STATE_MT); | 566 luaL_newmetatable(L, STATE_MT); |
572 { | 567 { |
573 | 568 |
574 lua_pushliteral(L, STATE_MT); | 569 lua_pushliteral(L, STATE_MT); |