diff --git a/src/libs/utils/qtcassert.cpp b/src/libs/utils/qtcassert.cpp index d371b6f6..1db95aad 100644 --- a/src/libs/utils/qtcassert.cpp +++ b/src/libs/utils/qtcassert.cpp @@ -11,7 +11,9 @@ #if defined(Q_OS_UNIX) #include #include +#ifdef __GLIBC__ #include +#endif #elif defined(_MSC_VER) #ifdef QTCREATOR_PCH_H #define CALLBACK WINAPI @@ -29,7 +31,7 @@ void dumpBacktrace(int maxdepth) const int ArraySize = 1000; if (maxdepth < 0 || maxdepth > ArraySize) maxdepth = ArraySize; -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && defined(__GLIBC__) void *bt[ArraySize] = {nullptr}; int size = backtrace(bt, maxdepth); char **lines = backtrace_symbols(bt, size); diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp index ba8afd56..4040dc6a 100644 --- a/src/plugins/qmldesigner/libs/designercore/exceptions/exception.cpp +++ b/src/plugins/qmldesigner/libs/designercore/exceptions/exception.cpp @@ -4,7 +4,9 @@ #include "exception.h" #ifdef Q_OS_LINUX +#if defined(__GLIBC__) #include +#endif #include #endif @@ -76,6 +78,7 @@ bool Exception::warnAboutException() } #ifdef Q_OS_LINUX +#ifdef __GLIBC__ static QString getBackTrace() { QString backTrace; @@ -91,6 +94,7 @@ static QString getBackTrace() return backTrace; } #endif +#endif QString Exception::defaultDescription(int line, const QByteArray &function, const QByteArray &file) { @@ -114,8 +118,10 @@ Exception::Exception(int line, const QByteArray &function, , m_file(QString::fromUtf8(file)) , m_description(description) #ifdef Q_OS_LINUX + #ifdef __GLIBC__ , m_backTrace(getBackTrace()) #endif + #endif { if (s_shouldAssert) { qDebug() << Exception::description();