From 9ec1343e2aea20851203040290c57bcbd96a5a64 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 12 Jan 2020 18:46:42 +0000 Subject: [PATCH] use __PRETTY_FUNCTION__ for Q_FUNC_INFO when compiler is GCC/Clang, __func__ if other Signed-off-by: Ivailo Monev --- src/core/global/qglobal.h.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/core/global/qglobal.h.cmake b/src/core/global/qglobal.h.cmake index a1ee12f67..6ae218d51 100644 --- a/src/core/global/qglobal.h.cmake +++ b/src/core/global/qglobal.h.cmake @@ -703,20 +703,10 @@ Q_CORE_EXPORT void qBadAlloc(); template inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; } -#if defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS) +#if defined(Q_CC_GNU) || defined(Q_CC_CLANG) # define Q_FUNC_INFO __PRETTY_FUNCTION__ #else -# if defined(Q_OS_SOLARIS) -# define Q_FUNC_INFO __FILE__ "(line number unavailable)" -# else - /* These two macros makes it possible to turn the builtin line expander into a - * string literal. */ -# define QT_STRINGIFY2(x) #x -# define QT_STRINGIFY(x) QT_STRINGIFY2(x) -# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__) -# endif -# undef QT_STRINGIFY2 -# undef QT_STRINGIFY +# define Q_FUNC_INFO __func__ #endif enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };