aboutsummaryrefslogtreecommitdiff
path: root/src/luasocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/luasocket.c')
-rw-r--r--src/luasocket.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/luasocket.c b/src/luasocket.c
index c4eeab3..7d9c802 100644
--- a/src/luasocket.c
+++ b/src/luasocket.c
@@ -17,6 +17,7 @@
17\*=========================================================================*/ 17\*=========================================================================*/
18#include "lua.h" 18#include "lua.h"
19#include "lauxlib.h" 19#include "lauxlib.h"
20#include "compat.h"
20 21
21/*=========================================================================*\ 22/*=========================================================================*\
22* LuaSocket includes 23* LuaSocket includes
@@ -83,12 +84,8 @@ static int global_unload(lua_State *L) {
83static int base_open(lua_State *L) { 84static int base_open(lua_State *L) {
84 if (socket_open()) { 85 if (socket_open()) {
85 /* export functions (and leave namespace table on top of stack) */ 86 /* export functions (and leave namespace table on top of stack) */
86#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
87 lua_newtable(L); 87 lua_newtable(L);
88 luaL_setfuncs(L, func, 0); 88 luaL_setfuncs(L, func, 0);
89#else
90 luaL_openlib(L, "socket", func, 0);
91#endif
92#ifdef LUASOCKET_DEBUG 89#ifdef LUASOCKET_DEBUG
93 lua_pushstring(L, "_DEBUG"); 90 lua_pushstring(L, "_DEBUG");
94 lua_pushboolean(L, 1); 91 lua_pushboolean(L, 1);