X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb9010ed40454cc978a9cbaa6de2ee41ea8b6c84..70aedad68fe4fc59134c55055b35f35a5ce3fd7a:/src/os2/gsocket.c diff --git a/src/os2/gsocket.c b/src/os2/gsocket.c index 4f53fa5fc0..db5644dad7 100644 --- a/src/os2/gsocket.c +++ b/src/os2/gsocket.c @@ -7,22 +7,53 @@ */ #include "wx/setup.h" +#ifndef __EMX__ +/* I don't see, why this include is needed, but it seems to be necessary + sometimes. For EMX, including C++ headers into plain C source breaks + compilation, so don't do it there. */ #include "wx/defs.h" +#endif #if wxUSE_SOCKETS -#define BSD_SELECT // use Berkley Sockets select +#define BSD_SELECT /* use Berkley Sockets select */ #include -#include #include -#include +#ifdef __EMX__ +#include +#include +#include +#include +#include +#define HAVE_INET_ADDR +#else #include #include #include #include #include +#endif +#if defined(__VISAGECPP__) && __IBMCPP__ < 400 +#include +#include #include +#else +#include +#include +#include +#ifdef __EMX__ +#define soclose(a) close(a) +#else +#define select(a,b,c,d,e) bsdselect(a,b,c,d,e) +int _System bsdselect(int, + struct fd_set *, + struct fd_set *, + struct fd_set *, + struct timeval *); +int _System soclose(int); +#endif +#endif #include #include @@ -1095,6 +1126,11 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) return GSOCK_NOERROR; } +GSocketError GAddress_INET_SetAnyAddress(GAddress *address) +{ + return GAddress_INET_SetHostAddress(address, INADDR_ANY); +} + GSocketError GAddress_INET_SetHostAddress(GAddress *address, unsigned long hostaddr) { @@ -1204,5 +1240,32 @@ unsigned short GAddress_INET_GetPort(GAddress *address) return ntohs(addr->sin_port); } +/* + * ------------------------------------------------------------------------- + * Unix address family + * ------------------------------------------------------------------------- + */ + +GSocketError _GAddress_Init_UNIX(GAddress *address) +{ + assert (address != NULL); + address->m_error = GSOCK_INVADDR; + return GSOCK_INVADDR; +} + +GSocketError GAddress_UNIX_SetPath(GAddress *address, const char *path) +{ + assert (address != NULL); + address->m_error = GSOCK_INVADDR; + return GSOCK_INVADDR; +} + +GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf) +{ + assert (address != NULL); + address->m_error = GSOCK_INVADDR; + return GSOCK_INVADDR; +} + #endif /* wxUSE_SOCKETS */