]> git.saurik.com Git - wxWidgets.git/commitdiff
fix compilation due to the fact that wx/socket.h no longer includes system socket...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Dec 2008 00:07:48 +0000 (00:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Dec 2008 00:07:48 +0000 (00:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/sockets/client.cpp

index ce196d8cd632bfdced3efa10170519b521e3787f..9147a03045e936aced603b59bf3760e2b1aeba20 100644 (file)
@@ -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