From 75b2497f2b15b4142376b754d292cc92185df22f Mon Sep 17 00:00:00 2001 From: Jonne Nauha Date: Wed, 3 Apr 2013 01:52:22 +0300 Subject: [PATCH] Fix intrusive_ptr template init on windows. The second template argument should probably be removed if its not neccesary for other platforms. I did not find boost documentation for what the second argument actually does, but in the meanwhile ifdeffed so that builds on windows (yes its ugly). Fixes #198 (with a semi hack). --- websocketpp/endpoint.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp index ae1f63f594..a70175a6a7 100644 --- a/websocketpp/endpoint.hpp +++ b/websocketpp/endpoint.hpp @@ -304,7 +304,14 @@ public: */ connection_ptr get_con_from_hdl(connection_hdl hdl, lib::error_code & ec) { scoped_lock_type lock(m_mutex); +/** @todo This wont build on windows with null as the second template argument. + I tried to look at the boost docs for this and cound not find why the second param is here. + Cleanup ifdefs when verified this builds on other systems. */ +#ifdef WIN32 + connection_ptr con = lib::static_pointer_cast( +#else connection_ptr con = lib::static_pointer_cast( +#endif hdl.lock()); if (!con) { ec = error::make_error_code(error::bad_connection);