aboutsummaryrefslogtreecommitdiff
path: root/src/udp.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/udp.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/udp.c')
-rw-r--r--src/udp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/udp.c b/src/udp.c
index 12e320a..f02f4c4 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -7,6 +7,7 @@
7 7
8#include "lua.h" 8#include "lua.h"
9#include "lauxlib.h" 9#include "lauxlib.h"
10#include "compat.h"
10 11
11#include "auxiliar.h" 12#include "auxiliar.h"
12#include "socket.h" 13#include "socket.h"
@@ -120,11 +121,7 @@ int udp_open(lua_State *L)
120 auxiliar_add2group(L, "udp{connected}", "select{able}"); 121 auxiliar_add2group(L, "udp{connected}", "select{able}");
121 auxiliar_add2group(L, "udp{unconnected}", "select{able}"); 122 auxiliar_add2group(L, "udp{unconnected}", "select{able}");
122 /* define library functions */ 123 /* define library functions */
123#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
124 luaL_setfuncs(L, func, 0); 124 luaL_setfuncs(L, func, 0);
125#else
126 luaL_openlib(L, NULL, func, 0);
127#endif
128 return 0; 125 return 0;
129} 126}
130 127