libstrawberry-common: check for library/includes for backtrace() (#364)
This is a non-standard header, so it should be checked properly. This fixes compilation with musl libc and possibly other C library implementations.
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "backtrace_inc.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QByteArray>
|
||||
#include <QList>
|
||||
@@ -32,9 +34,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
#include "logging.h"
|
||||
|
||||
@@ -255,7 +254,7 @@ QString DemangleSymbol(const QString &symbol) {
|
||||
}
|
||||
|
||||
void DumpStackTrace() {
|
||||
#ifdef Q_OS_UNIX
|
||||
#ifdef HAVE_BACKTRACE
|
||||
void* callstack[128];
|
||||
int callstack_size = backtrace(reinterpret_cast<void**>(&callstack), sizeof(callstack));
|
||||
char** symbols = backtrace_symbols(reinterpret_cast<void**>(&callstack), callstack_size);
|
||||
|
||||
Reference in New Issue
Block a user