#endif
#include <signal.h>
-#ifndef SOCKLEN_T
+#ifndef WX_SOCKLEN_T
#ifdef VMS
-# define SOCKLEN_T unsigned int
+# define WX_SOCKLEN_T unsigned int
#else
# ifdef __GLIBC__
# if __GLIBC__ == 2
-# define SOCKLEN_T socklen_t
+# define WX_SOCKLEN_T socklen_t
# endif
# elif defined(__WXMAC__)
-# define SOCKLEN_T socklen_t
+# define WX_SOCKLEN_T socklen_t
# else
-# define SOCKLEN_T int
+# define WX_SOCKLEN_T int
# endif
#endif
#endif /* SOCKLEN_T */
#ifndef SOCKOPTLEN_T
-#define SOCKOPTLEN_T SOCKLEN_T
+#define SOCKOPTLEN_T WX_SOCKLEN_T
#endif
/*
#else
# include "gsockunx.h"
# include "gsocket.h"
+# ifndef WXUNUSED
+# define WXUNUSED(x)
+# endif
#endif /* __GSOCKET_STANDALONE__ */
/* debugging helpers */
{}
bool GSocketGUIFunctionsTableNull::CanUseEventLoop()
{ return false; }
-bool GSocketGUIFunctionsTableNull::Init_Socket(GSocket *socket)
+bool GSocketGUIFunctionsTableNull::Init_Socket(GSocket *WXUNUSED(socket))
{ return true; }
-void GSocketGUIFunctionsTableNull::Destroy_Socket(GSocket *socket)
+void GSocketGUIFunctionsTableNull::Destroy_Socket(GSocket *WXUNUSED(socket))
{}
-void GSocketGUIFunctionsTableNull::Install_Callback(GSocket *socket, GSocketEvent event)
+void GSocketGUIFunctionsTableNull::Install_Callback(GSocket *WXUNUSED(socket), GSocketEvent WXUNUSED(event))
{}
-void GSocketGUIFunctionsTableNull::Uninstall_Callback(GSocket *socket, GSocketEvent event)
+void GSocketGUIFunctionsTableNull::Uninstall_Callback(GSocket *WXUNUSED(socket), GSocketEvent WXUNUSED(event))
{}
-void GSocketGUIFunctionsTableNull::Enable_Events(GSocket *socket)
+void GSocketGUIFunctionsTableNull::Enable_Events(GSocket *WXUNUSED(socket))
{}
-void GSocketGUIFunctionsTableNull::Disable_Events(GSocket *socket)
+void GSocketGUIFunctionsTableNull::Disable_Events(GSocket *WXUNUSED(socket))
{}
/* Global initialisers */
{
GAddress *address;
struct sockaddr addr;
- SOCKLEN_T size = sizeof(addr);
+ WX_SOCKLEN_T size = sizeof(addr);
GSocketError err;
assert(this);
return NULL;
}
- if (getsockname(m_fd, &addr, (SOCKLEN_T *) &size) < 0)
+ if (getsockname(m_fd, &addr, (WX_SOCKLEN_T *) &size) < 0)
{
m_error = GSOCK_IOERR;
return NULL;
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
(getsockname(m_fd,
m_local->m_addr,
- (SOCKLEN_T *) &m_local->m_len) != 0) ||
+ (WX_SOCKLEN_T *) &m_local->m_len) != 0) ||
(listen(m_fd, 5) != 0))
{
Close();
GSocket *GSocket::WaitConnection()
{
struct sockaddr from;
- SOCKLEN_T fromlen = sizeof(from);
+ WX_SOCKLEN_T fromlen = sizeof(from);
GSocket *connection;
GSocketError err;
int arg = 1;
return NULL;
}
- connection->m_fd = accept(m_fd, &from, (SOCKLEN_T *) &fromlen);
+ connection->m_fd = accept(m_fd, &from, (WX_SOCKLEN_T *) &fromlen);
/* Reenable CONNECTION events */
Enable(GSOCK_CONNECTION);
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
(getsockname(m_fd,
m_local->m_addr,
- (SOCKLEN_T *) &m_local->m_len) != 0))
+ (WX_SOCKLEN_T *) &m_local->m_len) != 0))
{
Close();
m_error = GSOCK_IOERR;
int GSocket::Recv_Dgram(char *buffer, int size)
{
struct sockaddr from;
- SOCKLEN_T fromlen = sizeof(from);
+ WX_SOCKLEN_T fromlen = sizeof(from);
int ret;
GSocketError err;
do
{
- ret = recvfrom(m_fd, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen);
+ ret = recvfrom(m_fd, buffer, size, 0, &from, (WX_SOCKLEN_T *) &fromlen);
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
if (ret == -1)