From: Vadim Zeitlin Date: Tue, 30 Dec 2008 00:07:48 +0000 (+0000) Subject: fix compilation due to the fact that wx/socket.h no longer includes system socket... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/778f682e4da54c65109fafce67beed57f33f551b fix compilation due to the fact that wx/socket.h no longer includes system socket headers and so AF_INET (which we don't need here in the first place) is not defined any more git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/sockets/client.cpp b/samples/sockets/client.cpp index ce196d8cd6..9147a03045 100644 --- a/samples/sockets/client.cpp +++ b/samples/sockets/client.cpp @@ -77,7 +77,7 @@ public: void OnOpenConnectionIPv6(wxCommandEvent& event); #endif - void OpenConnection(int family = AF_INET); + void OpenConnection(wxSockAddress::Family family); // event handlers for DatagramSocket menu (stub) void OnDatagram(wxCommandEvent& event); @@ -273,29 +273,28 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnOpenConnection(wxCommandEvent& WXUNUSED(event)) { - OpenConnection(AF_INET); + OpenConnection(wxSockAddress::IPV4); } #if wxUSE_IPV6 void MyFrame::OnOpenConnectionIPv6(wxCommandEvent& WXUNUSED(event)) { - OpenConnection(AF_INET6); + OpenConnection(wxSockAddress::IPV6); } #endif // wxUSE_IPV6 -void MyFrame::OpenConnection(int family) +void MyFrame::OpenConnection(wxSockAddress::Family family) { + wxUnusedVar(family); // unused in !wxUSE_IPV6 case + wxIPaddress * addr; wxIPV4address addr4; #if wxUSE_IPV6 wxIPV6address addr6; - if ( family==AF_INET6 ) + if ( family == wxSockAddress::IPV6 ) addr = &addr6; else - addr = &addr4; -#else - wxUnusedVar(family); - addr = &addr4; #endif + addr = &addr4; m_menuSocket->Enable(CLIENT_OPEN, false); #if wxUSE_IPV6