Merge pull request #3459 from Voyager1/fix-build
authorVoyager1 <voyager@xbmc.org>
Fri, 1 Nov 2013 05:54:10 +0000 (22:54 -0700)
committerVoyager1 <voyager@xbmc.org>
Fri, 1 Nov 2013 05:54:10 +0000 (22:54 -0700)
[Win32] improved resolution of conflict with namespace std::bind()

xbmc/network/Network.cpp

index 7bbb7d5..d9b12c5 100644 (file)
@@ -30,8 +30,6 @@
 #include "utils/SystemInfo.h"
 #endif
 
-using namespace std;
-
 /* slightly modified in_ether taken from the etherboot project (http://sourceforge.net/projects/etherboot) */
 bool in_ether (const char *bufp, unsigned char *addr)
 {
@@ -169,8 +167,8 @@ CStdString CNetwork::GetHostName(void)
 
 CNetworkInterface* CNetwork::GetFirstConnectedInterface()
 {
-   vector<CNetworkInterface*>& ifaces = GetInterfaceList();
-   vector<CNetworkInterface*>::const_iterator iter = ifaces.begin();
+   std::vector<CNetworkInterface*>& ifaces = GetInterfaceList();
+   std::vector<CNetworkInterface*>::const_iterator iter = ifaces.begin();
    while (iter != ifaces.end())
    {
       CNetworkInterface* iface = *iter;
@@ -186,8 +184,8 @@ bool CNetwork::HasInterfaceForIP(unsigned long address)
 {
    unsigned long subnet;
    unsigned long local;
-   vector<CNetworkInterface*>& ifaces = GetInterfaceList();
-   vector<CNetworkInterface*>::const_iterator iter = ifaces.begin();
+   std::vector<CNetworkInterface*>& ifaces = GetInterfaceList();
+   std::vector<CNetworkInterface*>::const_iterator iter = ifaces.begin();
    while (iter != ifaces.end())
    {
       CNetworkInterface* iface = *iter;
@@ -213,7 +211,7 @@ bool CNetwork::IsAvailable(bool wait /*= false*/)
     //       wait for 5 seconds here.
   }
 
-  vector<CNetworkInterface*>& ifaces = GetInterfaceList();
+  std::vector<CNetworkInterface*>& ifaces = GetInterfaceList();
   return (ifaces.size() != 0);
 }
 
@@ -224,8 +222,8 @@ bool CNetwork::IsConnected()
 
 CNetworkInterface* CNetwork::GetInterfaceByName(CStdString& name)
 {
-   vector<CNetworkInterface*>& ifaces = GetInterfaceList();
-   vector<CNetworkInterface*>::const_iterator iter = ifaces.begin();
+   std::vector<CNetworkInterface*>& ifaces = GetInterfaceList();
+   std::vector<CNetworkInterface*>::const_iterator iter = ifaces.begin();
    while (iter != ifaces.end())
    {
       CNetworkInterface* iface = *iter;
@@ -471,7 +469,7 @@ int CreateTCPServerSocket(const int port, const bool bindLocal, const int backlo
     else
       s6->sin6_addr = in6addr_any;
 
-    if (::bind( sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in6)) < 0)
+    if (bind( sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in6)) < 0)
     {
       closesocket(sock);
       sock = -1;
@@ -494,7 +492,7 @@ int CreateTCPServerSocket(const int port, const bool bindLocal, const int backlo
     else
       s4->sin_addr.s_addr = htonl(INADDR_ANY);
 
-    if (::bind( sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)) < 0)
+    if (bind( sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)) < 0)
     {
       closesocket(sock);
       CLog::Log(LOGERROR, "%s Server: Failed to bind ipv4 serversocket", callerName);