socketio / socket.io-client-cpp

C++11 implementation of Socket.IO client
MIT License
2.25k stars 725 forks source link

Visual Studio 2013 Debug Configuration Compile Error #192

Open SvenKordon opened 6 years ago

SvenKordon commented 6 years ago

You want to:

Current behaviour

The Code does not compile in Visual Studio 2013 with Debug configuration.

Steps to reproduce (if the current behaviour is a bug)

Compiling the source code in Visual Studio with an active Debug configuration results in the following error messages:

sio_client\socket.io-client-cpp-6063cb1\sio_client\internal\sio_client_impl.cpp(283): error C3321: initializer-list unexpected in this context sio_client\socket.io-client-cpp-6063cb1\sio_client\internal\sio_client_impl.cpp(497): error C3321: initializer-list unexpected in this context

The Problem is a missing semicolon at the end of the LOG() define:

if(ec)LOG("ec:"<<ec.message()<<endl){}; should be if(ec)LOG("ec:"<<ec.message()<<endl);{};

I'm not able to send a pull request because I'm not using GIT. Therefore it would be great if someone else could test my patch and add it to a pull request.

I am also open for discussion on other solutions. It would be great if my patch could make it in the next release because I'd prefer to use the library without private modification.

Thanks a lot in advance.

Setup

Other information (e.g. stacktraces, related issues, suggestions how to fix)

The problem can be fixed by the following patch:

--- 3rdParty-OpenSource/sio_client/socket.io-client-cpp-6063cb1/sio_client/internal/sio_client_impl.cpp 2018-01-30 11:42:04.000000000 +0100
+++ 3rdParty-OpenSource/sio_client/socket.io-client-cpp-6063cb1/sio_client/internal/sio_client_impl.cpp 2018-02-02 17:09:27.000000609 +0100
@@ -280,7 +280,7 @@
         if(ec || m_con.expired())
         {
             if (ec != boost::asio::error::operation_aborted)
-                LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl){};
+                LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);{};
             return;
         }
         packet p(packet::frame_ping);
@@ -494,7 +494,7 @@
             m_ping_timer.reset(new boost::asio::deadline_timer(m_client.get_io_service()));
             boost::system::error_code ec;
             m_ping_timer->expires_from_now(milliseconds(m_ping_interval), ec);
-            if(ec)LOG("ec:"<<ec.message()<<endl){};
+            if(ec)LOG("ec:"<<ec.message()<<endl);{};
             m_ping_timer->async_wait(lib::bind(&client_impl::ping,this,lib::placeholders::_1));
             LOG("On handshake,sid:"<<m_sid<<",ping interval:"<<m_ping_interval<<",ping timeout"<<m_ping_timeout<<endl);
             return;
nfyfamr commented 6 years ago

hi, how this work is going? this issue is not reflected at working branch still. but I thinks It should be.