diff --git a/polymer/eduke32/source/enet/include/enet/unix.h b/polymer/eduke32/source/enet/include/enet/unix.h index 087015e51..244984f8f 100644 --- a/polymer/eduke32/source/enet/include/enet/unix.h +++ b/polymer/eduke32/source/enet/include/enet/unix.h @@ -8,7 +8,13 @@ #include #include #include -#include + +#if defined(GEKKO) +# include +#else +# include +#endif + #include typedef int ENetSocket; diff --git a/polymer/eduke32/source/enet/src/unix.c b/polymer/eduke32/source/enet/src/unix.c index 6230350bd..c0df99b1a 100644 --- a/polymer/eduke32/source/enet/src/unix.c +++ b/polymer/eduke32/source/enet/src/unix.c @@ -4,12 +4,40 @@ */ #ifndef WIN32 -#include -#include -#include +#if defined(GEKKO) +# include +# define gethostbyname net_gethostbyname +# define gethostbyaddr(...) (NULL) +# define bind net_bind +# define listen net_listen +# define socket net_socket +# define ioctl net_ioctl +# define connect net_connect +# define setsockopt net_setsockopt +# define accept net_accept +# define select net_select +struct msghdr { + void *msg_name; /* optional address */ + socklen_t msg_namelen; /* size of address */ + struct iovec *msg_iov; /* scatter/gather array */ + size_t msg_iovlen; /* # elements in msg_iov */ + void *msg_control; /* ancillary data, see below */ + socklen_t msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ +}; +# define sendmsg(...) (-1) +# define recvmsg(...) (-1) +# define SOMAXCONN 5 + +#else +# include +# include +# include +# include +# include +#endif + #include -#include -#include #include #include #include