aboutsummaryrefslogtreecommitdiff
path: root/src/inet.c
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2015-08-21 15:39:34 -0300
committerDiego Nehab <diego.nehab@gmail.com>2015-08-21 15:39:34 -0300
commite75444ccd1f30a3b5fbc7cec4a85e831bd0560ed (patch)
tree71475c18fee070c770fc0fe25d0859b7d54c8fbb /src/inet.c
parent321c0c9b1f7b6b83cd83b58e7e259f53eca69373 (diff)
downloadluasocket-e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed.tar.gz
luasocket-e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed.tar.bz2
luasocket-e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed.zip
New compat.h module implements luaL_setfuncs.
Makes initialization code simpler everywhere.
Diffstat (limited to 'src/inet.c')
-rw-r--r--src/inet.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/inet.c b/src/inet.c
index 48e654b..68087db 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -8,6 +8,7 @@
8 8
9#include "lua.h" 9#include "lua.h"
10#include "lauxlib.h" 10#include "lauxlib.h"
11#include "compat.h"
11 12
12#include "inet.h" 13#include "inet.h"
13 14
@@ -41,11 +42,7 @@ int inet_open(lua_State *L)
41{ 42{
42 lua_pushstring(L, "dns"); 43 lua_pushstring(L, "dns");
43 lua_newtable(L); 44 lua_newtable(L);
44#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
45 luaL_setfuncs(L, func, 0); 45 luaL_setfuncs(L, func, 0);
46#else
47 luaL_openlib(L, NULL, func, 0);
48#endif
49 lua_settable(L, -3); 46 lua_settable(L, -3);
50 return 0; 47 return 0;
51} 48}