#ifdef __VMS__
#include <socket.h>
-struct sockaddr_un {
+struct sockaddr_un {
u_char sun_len; /* sockaddr len including null */
u_char sun_family; /* AF_UNIX */
char sun_path[108]; /* path name (gag) */
#endif
#include <signal.h>
-
#ifndef SOCKLEN_T
#ifdef VMS
#ifndef __GSOCKET_STANDALONE__
-#include "wx/gsocket.h"
#include "wx/unix/gsockunx.h"
+#include "wx/gsocket.h"
#else
-#include "gsocket.h"
#include "gsockunx.h"
+#include "gsocket.h"
#endif /* __GSOCKET_STANDALONE__ */
+/* redefine some GUI-only functions to do nothing in console mode */
+#if defined(wxUSE_GUI) && !wxUSE_GUI
+ #define _GSocket_GUI_Init(socket)
+ #define _GSocket_GUI_Destroy(socket)
+ #define _GSocket_Enable_Events(socket)
+ #define _GSocket_Disable_Events(socket)
+ #define _GSocket_Install_Callback(socket, event)
+ #define _GSocket_Uninstall_Callback(socket, event)
+#endif /* wxUSE_GUI */
/* Global initialisers */
for (evt = 0; evt < GSOCK_MAX_EVENT; evt++)
socket->m_cbacks[evt] = NULL;
- socket->m_detected = 0;
+ socket->m_detected = GSOCK_LOST_FLAG;
_GSocket_Disable_Events(socket);
}
{
assert(socket != NULL);
- return (flags & socket->m_detected);
+ return flags & socket->m_detected;
}
/* Flags */
int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size)
{
- int ret;
-
- MASK_SIGNAL();
- ret = recv(socket->m_fd, buffer, size, 0);
- UNMASK_SIGNAL();
-
- return ret;
+ return recv(socket->m_fd, buffer, size, 0);
}
int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size)
fromlen = sizeof(from);
- MASK_SIGNAL();
ret = recvfrom(socket->m_fd, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen);
- UNMASK_SIGNAL();
if (ret == -1)
return -1;