LuaSocket: Enable Unix sockets in Windows

This commit is contained in:
Miku AuahDark
2022-10-08 13:21:56 +08:00
parent 984391bed5
commit 857cf40636
4 changed files with 17 additions and 6 deletions
@@ -12,7 +12,11 @@
#include <string.h>
#include <stdlib.h>
#ifdef _WIN32
#include <afunix.h>
#else
#include <sys/un.h>
#endif
#define UNIXDGRAM_DATAGRAMSIZE 8192
@@ -10,7 +10,12 @@
#include "unixstream.h"
#include <string.h>
#ifdef _WIN32
#include <afunix.h>
#else
#include <sys/un.h>
#endif
/*=========================================================================*\
* Internal function prototypes
+2
View File
@@ -24,6 +24,7 @@
extern "C" {
#include "libluasocket/luasocket.h"
#include "libluasocket/mime.h"
#include "libluasocket/unix.h"
}
// Lua files
@@ -84,6 +85,7 @@ int preload(lua_State * L)
// Preload code from LuaSocket.
preload(L, "socket.core", luaopen_socket_core);
preload(L, "socket.unix", luaopen_socket_unix);
preload(L, "mime.core", luaopen_mime_core);
preload(L, "socket", "=[socket \"socket.lua\"]", socket_lua, sizeof(socket_lua));