socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

Parse Issue Xcode

Open aelitneg opened this issue 6 years ago • 0 comments

When building in Xcode, build fails with a Parse Error: Screen Shot 2019-07-06 at 10 04 33 PM

The file is sio_client_impl.cpp, lines 282 and 496 respectively.

Error 1:

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){};
     return;
}

Error 2:

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

It seems like the curly braces for the if blocks got messed up somewhere. I fixed it with the following solutions:

Soltuion 1:

if (ec != boost::asio::error::operation_aborted) 
{
     LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
      return;
}

Solution 2:

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

If these are indeed an issue, I've got a branch to submit a PR. Otherwise, please excuse my ignorance as I've been in Javascript land for a while now.

aelitneg avatar Jul 07 '19 03:07 aelitneg