Software /
code /
prosody
Comparison
util-src/net.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 | 6615:8e4572a642cb |
child | 7818:54669df178c2 |
comparison
equal
deleted
inserted
replaced
6788:d64c1f3c7e2e | 6789:6b180e77c97a |
---|---|
24 #endif | 24 #endif |
25 | 25 |
26 #include <lua.h> | 26 #include <lua.h> |
27 #include <lauxlib.h> | 27 #include <lauxlib.h> |
28 | 28 |
29 #if (LUA_VERSION_NUM == 502) | 29 #if (LUA_VERSION_NUM == 501) |
30 #define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) | 30 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R) |
31 #endif | 31 #endif |
32 | 32 |
33 /* Enumerate all locally configured IP addresses */ | 33 /* Enumerate all locally configured IP addresses */ |
34 | 34 |
35 const char* const type_strings[] = { | 35 const char* const type_strings[] = { |
129 { "local_addresses", lc_local_addresses }, | 129 { "local_addresses", lc_local_addresses }, |
130 { NULL, NULL } | 130 { NULL, NULL } |
131 }; | 131 }; |
132 | 132 |
133 lua_newtable(L); | 133 lua_newtable(L); |
134 luaL_register(L, NULL, exports); | 134 luaL_setfuncs(L, exports, 0); |
135 return 1; | 135 return 1; |
136 } | 136 } |