From 1082c44de0fadd3eb45a697c55c9b67603ae7a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Wed, 5 Oct 2016 19:53:54 -0400 Subject: Disambiguate reference to ::bind() There's a potential ambiguity between ::bind() and std::bind() if happens to be included beforehand (as is the case with libc++). --- src/sockets/socket.cpp | 6 +++--- src/stun/udp.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sockets/socket.cpp b/src/sockets/socket.cpp index dc9b862..2d828dd 100644 --- a/src/sockets/socket.cpp +++ b/src/sockets/socket.cpp @@ -86,7 +86,7 @@ t_socket_udp::t_socket_udp() { addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(0); - ret = bind(sd, (struct sockaddr *)&addr, sizeof(addr)); + ret = ::bind(sd, (struct sockaddr *)&addr, sizeof(addr)); if (ret < 0) throw errno; } @@ -100,7 +100,7 @@ t_socket_udp::t_socket_udp(unsigned short port) { addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(port); - ret = bind(sd, (struct sockaddr *)&addr, sizeof(addr)); + ret = ::bind(sd, (struct sockaddr *)&addr, sizeof(addr)); if (ret < 0) throw errno; } @@ -295,7 +295,7 @@ t_socket_tcp::t_socket_tcp(unsigned short port) { addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(port); - ret = bind(sd, (struct sockaddr *)&addr, sizeof(addr)); + ret = ::bind(sd, (struct sockaddr *)&addr, sizeof(addr)); if (ret < 0) throw errno; } diff --git a/src/stun/udp.cxx b/src/stun/udp.cxx index 7a75134..1472b13 100644 --- a/src/stun/udp.cxx +++ b/src/stun/udp.cxx @@ -64,7 +64,7 @@ openPort( unsigned short port, unsigned int interfaceIp, bool verbose ) } } - if ( bind( fd,(struct sockaddr*)&addr, sizeof(addr)) != 0 ) + if ( ::bind( fd,(struct sockaddr*)&addr, sizeof(addr)) != 0 ) { int e = getErrno(); -- cgit v1.2.3