Add simple header wrapper that provides sockaddr_un.

This commit is contained in:
Miku AuahDark 2022-12-28 14:36:51 +08:00
parent de359ea408
commit 5dd6a2cb14
No known key found for this signature in database
GPG Key ID: EFB853D1AB989C18

26
src/unixdef.h Normal file
View 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 */