// Some patch ///// END
/////////////////////////////////////////////////////////////////////////////
+#ifdef GetClassInfo
+#undef GetClassInfo
+#endif
+
// --------------------------------------------------------------
// Module
// --------------------------------------------------------------
{
SockMsg msg;
+ // warning about 'cast truncates constant value'
+#ifdef _MSC_VER
+ #pragma warning(disable: 4310)
+#endif // _MSC_VER
+
msg.sig[0] = (char) 0xad;
msg.sig[1] = (char) 0xde;
msg.sig[2] = (char) 0xed;
Write((char *)&msg, sizeof(msg));
return *this;
+
+#ifdef _MSC_VER
+ #pragma warning(default: 4310)
+#endif // _MSC_VER
}
wxSocketBase& wxSocketBase::Unread(const char *buffer, size_t nbytes)
// If what? Who seems to need unsigned int?
// BTW uint isn't even defined on wxMSW for VC++ for some reason. Even if it
// were, getpeername/getsockname don't take unsigned int*, they take int*.
-#if 0
-#define wxSOCKET_INT unsigned int
+//
+// Under glibc 2.0.7, socketbits.h declares socklen_t to be unsigned int
+// and it uses *socklen_t as the 3rd parameter. Robert.
+
+// JACS - How can we detect this?
+// Meanwhile, if your compiler complains about socklen_t,
+// switch lines below.
+
+#if wxHAVE_GLIBC2
+# define wxSOCKET_INT socklen_t
#else
-#define wxSOCKET_INT int
+# define wxSOCKET_INT int
#endif
// --------------------------------------------------------------
case FD_CONNECT:
sk_req = wxSocketBase::EVT_CONNECT;
break;
+
+ default:
+ wxFAIL_MSG("invalid socket event");
+ return (LRESULT)0;
}
+
sock->OnRequest(sk_req);
return (LRESULT)0;