From 5dd6a2cb146f04dd2178c2b43b1a421a5a9184e5 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Wed, 28 Dec 2022 14:36:51 +0800 Subject: [PATCH] Add simple header wrapper that provides sockaddr_un. --- src/unixdef.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/unixdef.h diff --git a/src/unixdef.h b/src/unixdef.h new file mode 100644 index 0000000..3bfa67f --- /dev/null +++ b/src/unixdef.h @@ -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 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 +#endif /* _WIN32 */ + +#endif /* UNIXDEF_H */