From 4ec6ffcef8bb6845f80fe7ce8f46c0f36bb5629c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 1 May 2012 12:39:41 +0000 Subject: [PATCH] Patch adding Wii support by tueidj, part 7: networking This simply macro-defines various low-level networking functions. git-svn-id: https://svn.eduke32.com/eduke32@2627 1a8010ca-5511-0410-912e-c29ae57300e0 --- .../eduke32/source/enet/include/enet/unix.h | 8 +++- polymer/eduke32/source/enet/src/unix.c | 38 ++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) 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