mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
LuaSocket: Enable Unix sockets in Windows
This commit is contained in:
+6
-6
@@ -1479,6 +1479,12 @@ set(LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET
|
||||
src/libraries/luasocket/libluasocket/udp.c
|
||||
src/libraries/luasocket/libluasocket/udp.h
|
||||
src/libraries/luasocket/libluasocket/url.lua.h
|
||||
src/libraries/luasocket/libluasocket/unix.c
|
||||
src/libraries/luasocket/libluasocket/unix.h
|
||||
src/libraries/luasocket/libluasocket/unixdgram.c
|
||||
src/libraries/luasocket/libluasocket/unixdgram.h
|
||||
src/libraries/luasocket/libluasocket/unixstream.c
|
||||
src/libraries/luasocket/libluasocket/unixstream.h
|
||||
)
|
||||
|
||||
set(LOVE_LINK_L3P_LUASOCKET_LIBLUASOCKET)
|
||||
@@ -1498,12 +1504,6 @@ else()
|
||||
set(LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET
|
||||
${LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET}
|
||||
src/libraries/luasocket/libluasocket/serial.c
|
||||
src/libraries/luasocket/libluasocket/unix.c
|
||||
src/libraries/luasocket/libluasocket/unix.h
|
||||
src/libraries/luasocket/libluasocket/unixdgram.c
|
||||
src/libraries/luasocket/libluasocket/unixdgram.h
|
||||
src/libraries/luasocket/libluasocket/unixstream.c
|
||||
src/libraries/luasocket/libluasocket/unixstream.h
|
||||
src/libraries/luasocket/libluasocket/usocket.c
|
||||
src/libraries/luasocket/libluasocket/usocket.h
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user