mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-27 11:19:53 +02:00
Merge c44d18bfb7
into 98be8d9fc1
This commit is contained in:
@ -324,8 +324,9 @@ UNIX_OBJS=\
|
||||
auxiliar.$(O) \
|
||||
options.$(O) \
|
||||
timeout.$(O) \
|
||||
inet.$(O) \
|
||||
io.$(O) \
|
||||
usocket.$(O) \
|
||||
$(SOCKET) \
|
||||
unixstream.$(O) \
|
||||
unixdgram.$(O) \
|
||||
compat.$(O) \
|
||||
@ -393,7 +394,7 @@ none:
|
||||
@echo "where PLATFORM is one of these:"
|
||||
@echo " $(PLATS)"
|
||||
|
||||
all: $(SOCKET_SO) $(MIME_SO)
|
||||
all: $(SOCKET_SO) $(MIME_SO) $(UNIX_SO)
|
||||
|
||||
$(SOCKET_SO): $(SOCKET_OBJS)
|
||||
$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
|
||||
@ -401,11 +402,11 @@ $(SOCKET_SO): $(SOCKET_OBJS)
|
||||
$(MIME_SO): $(MIME_OBJS)
|
||||
$(LD) $(MIME_OBJS) $(LDFLAGS)$@
|
||||
|
||||
all-unix: all $(UNIX_SO) $(SERIAL_SO)
|
||||
|
||||
$(UNIX_SO): $(UNIX_OBJS)
|
||||
$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
|
||||
|
||||
all-unix: all $(SERIAL_SO)
|
||||
|
||||
$(SERIAL_SO): $(SERIAL_OBJS)
|
||||
$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
|
||||
|
||||
|
26
src/unixdef.h
Normal file
26
src/unixdef.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef UNIXDEF_H
|
||||
#define UNIXDEF_H
|
||||
/*=========================================================================*\
|
||||
* Unix domain defines
|
||||
* LuaSocket toolkit
|
||||
*
|
||||
* Provides sockaddr_un on Windows and Unix.
|
||||
\*=========================================================================*/
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Technically it's possible to include <afunix.h> but it's only available
|
||||
on Windows SDK 17134 (Windows 10 1803). */
|
||||
#ifndef AF_UNIX
|
||||
#define AF_UNIX 1
|
||||
#endif
|
||||
|
||||
struct sockaddr_un
|
||||
{
|
||||
unsigned short sun_family;
|
||||
char sun_path[108];
|
||||
};
|
||||
#else
|
||||
#include <sys/un.h>
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#endif /* UNIXDEF_H */
|
@ -8,12 +8,11 @@
|
||||
#include "socket.h"
|
||||
#include "options.h"
|
||||
#include "unix.h"
|
||||
#include "unixdef.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/un.h>
|
||||
|
||||
#define UNIXDGRAM_DATAGRAMSIZE 8192
|
||||
|
||||
/* provide a SUN_LEN macro if sys/un.h doesn't (e.g. Android) */
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include "auxiliar.h"
|
||||
#include "socket.h"
|
||||
#include "options.h"
|
||||
#include "unixdef.h"
|
||||
#include "unixstream.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
/*=========================================================================*\
|
||||
* Internal function prototypes
|
||||
|
Reference in New Issue
Block a user