From 590894d283c591420c8d6f653466fa6007d60c33 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 11 May 2015 09:00:25 +0200 Subject: [PATCH] Fix macro for MSVC; fix #1063 --- servatrice/src/serversocketinterface.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/servatrice/src/serversocketinterface.cpp b/servatrice/src/serversocketinterface.cpp index 933eef00..86485661 100644 --- a/servatrice/src/serversocketinterface.cpp +++ b/servatrice/src/serversocketinterface.cpp @@ -164,14 +164,24 @@ void ServerSocketInterface::readClient() newCommandContainer.ParseFromArray(inputBuffer.data(), messageLength); } catch(std::exception &e) { - qDebug() << "Caught std::exception in" << __FILE__ << __LINE__ << __PRETTY_FUNCTION__; + qDebug() << "Caught std::exception in" << __FILE__ << __LINE__ << +#ifdef _MSC_VER // Visual Studio + __FUNCTION__; +#else + __PRETTY_FUNCTION__; +#endif qDebug() << "Exception:" << e.what(); qDebug() << "Message coming from:" << getAddress(); qDebug() << "Message length:" << messageLength; qDebug() << "Message content:" << inputBuffer.toHex(); } catch(...) { - qDebug() << "Unhandled exception in" << __FILE__ << __LINE__ << __PRETTY_FUNCTION__; + qDebug() << "Unhandled exception in" << __FILE__ << __LINE__ << +#ifdef _MSC_VER // Visual Studio + __FUNCTION__; +#else + __PRETTY_FUNCTION__; +#endif qDebug() << "Message coming from:" << getAddress(); }