diff options
author | Diego Nehab <diego.nehab@gmail.com> | 2015-08-21 15:39:34 -0300 |
---|---|---|
committer | Diego Nehab <diego.nehab@gmail.com> | 2015-08-21 15:39:34 -0300 |
commit | e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed (patch) | |
tree | 71475c18fee070c770fc0fe25d0859b7d54c8fbb /src/tcp.c | |
parent | 321c0c9b1f7b6b83cd83b58e7e259f53eca69373 (diff) | |
download | luasocket-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/tcp.c')
-rw-r--r-- | src/tcp.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include "lua.h" | 7 | #include "lua.h" |
8 | #include "lauxlib.h" | 8 | #include "lauxlib.h" |
9 | #include "compat.h" | ||
9 | 10 | ||
10 | #include "auxiliar.h" | 11 | #include "auxiliar.h" |
11 | #include "socket.h" | 12 | #include "socket.h" |
@@ -108,11 +109,7 @@ int tcp_open(lua_State *L) | |||
108 | auxiliar_add2group(L, "tcp{client}", "tcp{any}"); | 109 | auxiliar_add2group(L, "tcp{client}", "tcp{any}"); |
109 | auxiliar_add2group(L, "tcp{server}", "tcp{any}"); | 110 | auxiliar_add2group(L, "tcp{server}", "tcp{any}"); |
110 | /* define library functions */ | 111 | /* define library functions */ |
111 | #if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE) | ||
112 | luaL_setfuncs(L, func, 0); | 112 | luaL_setfuncs(L, func, 0); |
113 | #else | ||
114 | luaL_openlib(L, NULL, func, 0); | ||
115 | #endif | ||
116 | return 0; | 113 | return 0; |
117 | } | 114 | } |
118 | 115 | ||