]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/gsocket.c
don't draw cell highlight over the cell editor (improves wxGCBoolEditor appearance
[wxWidgets.git] / src / os2 / gsocket.c
index 0ea14036b81d920ba78b201778abd4165fd95857..db5644dad7430d73b6dc1518138ae125e6d6f23f 100644 (file)
@@ -7,7 +7,12 @@
  */
 
 #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
 
 
 #include <assert.h>
 #include <sys\types.h>
+#ifdef __EMX__
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <errno.h>
+#define HAVE_INET_ADDR
+#else
 #include <utils.h>
 #include <sys\time.h>
 #include <in.h>
 #include <netdb.h>
 #include <nerrno.h>
+#endif
 #if defined(__VISAGECPP__) && __IBMCPP__ < 400
 #include <socket.h>
 #include <ioctl.h>
@@ -28,6 +42,9 @@
 #include <sys\socket.h>
 #include <sys\ioctl.h>
 #include <sys\select.h>
+#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 *,
@@ -36,6 +53,7 @@ int _System bsdselect(int,
                       struct timeval *);
 int _System soclose(int);
 #endif
+#endif
 
 #include <string.h>
 #include <stdio.h>
@@ -1108,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)
 {
@@ -1217,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 */