From 2ff681bf0606c4cb5269420c47e92fafa3520e45 Mon Sep 17 00:00:00 2001 From: Luca Niccoli Date: Tue, 14 Apr 2015 11:31:02 +0200 Subject: [PATCH 1/2] Avoid symbol redefinition Apprently clang and msvc are fine with it, but GCC isn't. --- src/internal/sio_client_impl.h | 2 +- src/sio_client.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/sio_client_impl.h b/src/internal/sio_client_impl.h index c777d4ae..035322bf 100644 --- a/src/internal/sio_client_impl.h +++ b/src/internal/sio_client_impl.h @@ -89,7 +89,7 @@ void set_##__FIELD__(__TYPE__ const& l) \ // Client Functions - such as send, etc. void connect(const std::string& uri); - socket::ptr const& socket(const std::string& nsp); + ::sio::socket::ptr const& socket(const std::string& nsp); // Closes the connection void close(); diff --git a/src/sio_client.h b/src/sio_client.h index 960a533b..8febe847 100755 --- a/src/sio_client.h +++ b/src/sio_client.h @@ -62,7 +62,7 @@ namespace sio void set_reconnect_delay_max(unsigned millis); - socket::ptr const& socket(const std::string& nsp = ""); + ::sio::socket::ptr const& socket(const std::string& nsp = ""); // Closes the connection void close(); From 2924a9f373ab627fe79f16d995a83d5e4a70a765 Mon Sep 17 00:00:00 2001 From: Luca Niccoli Date: Tue, 14 Apr 2015 11:33:03 +0200 Subject: [PATCH 2/2] Use explicit template parametrization The arguments are of different types, so parameter deduction will not work. --- src/internal/sio_client_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/sio_client_impl.cpp b/src/internal/sio_client_impl.cpp index c3b3a23d..028fcad1 100644 --- a/src/internal/sio_client_impl.cpp +++ b/src/internal/sio_client_impl.cpp @@ -321,7 +321,7 @@ namespace sio unsigned client_impl::next_delay() const { //no jitter, fixed power root. - return (unsigned)min(m_reconn_delay * pow(1.5,m_reconn_made),m_reconn_delay_max); + return min(m_reconn_delay * pow(1.5,m_reconn_made),m_reconn_delay_max); } void client_impl::send(packet& p)