diff --git a/easy_profiler_core/easy_socket.cpp b/easy_profiler_core/easy_socket.cpp index a608cfa..c937ade 100644 --- a/easy_profiler_core/easy_socket.cpp +++ b/easy_profiler_core/easy_socket.cpp @@ -268,6 +268,12 @@ int EasySocket::accept() //int flag = 1; //int result = setsockopt(m_replySocket,IPPROTO_TCP,TCP_NODELAY,(char *)&flag,sizeof(int)); + // Apple doesn't have MSG_NOSIGNAL, work around it +#ifdef __APPLE__ + int value = 1; + setsockopt(m_replySocket, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value)); +#endif + //setBlocking(m_replySocket,true); } return (int)m_replySocket; @@ -309,6 +315,15 @@ int EasySocket::connect() { res = ::connect(m_socket,(struct sockaddr *) &serv_addr,sizeof(serv_addr)); + // on Apple, treat EISCONN error as success +#ifdef __APPLE__ + if (res == -1 && errno == EISCONN) + { + res = 0; + break; + } +#endif + checkResult(res); if (res == 0) @@ -339,6 +354,12 @@ int EasySocket::connect() setsockopt(m_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv,sizeof(struct timeval)); +#ifdef __APPLE__ + // Apple doesn't have MSG_NOSIGNAL, work around it + int value = 1; + setsockopt(m_socket, SOL_SOCKET, SO_NOSIGPIPE, &value, sizeof(value)); +#endif + m_replySocket = m_socket; } return res; diff --git a/profiler_gui/blocks_graphics_view.cpp b/profiler_gui/blocks_graphics_view.cpp index 66bcf0a..64d96fa 100644 --- a/profiler_gui/blocks_graphics_view.cpp +++ b/profiler_gui/blocks_graphics_view.cpp @@ -1130,8 +1130,8 @@ void EasyGraphicsView::mouseMoveEvent(QMouseEvent* _event) if (m_mouseButtons != 0) { - m_mouseMovePath.setX(m_mouseMovePath.x() + abs(delta.x())); - m_mouseMovePath.setY(m_mouseMovePath.y() + abs(delta.y())); + m_mouseMovePath.setX(m_mouseMovePath.x() + ::std::abs((double)delta.x())); + m_mouseMovePath.setY(m_mouseMovePath.y() + ::std::abs((double)delta.y())); } auto mouseScenePos = mapToScene(m_mousePressPos);