Fix build on Android
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 21 Jun 2013 12:05:56 +0000 (14:05 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 24 Jun 2013 08:43:08 +0000 (10:43 +0200)
Don't include execinfo.h and use open_memstream on Android

Change-Id: I5b45dd4fc7f3b435b35e1951d6e722d4b52a6ea4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4engine.cpp
src/qml/qml/v4/qv4isel_masm.cpp
src/qml/qml/v4/qv4unwindhelper_p-arm.h

index d7064a1..1bec916 100644 (file)
@@ -66,7 +66,8 @@
 #include "qv4qobjectwrapper_p.h"
 #include "qv4qmlextensions_p.h"
 
-#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
+#if (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || defined(Q_OS_MAC)
+#define HAVE_GNU_BACKTRACE
 #include <execinfo.h>
 #endif
 
@@ -604,7 +605,7 @@ namespace {
             engine = context->engine;
             currentNativeFrame = 0;
 
-#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
+#if defined(HAVE_GNU_BACKTRACE)
             UnwindHelper::prepareForUnwind(context);
 
             nativeFrameCount = backtrace(&trace[0], sizeof(trace) / sizeof(trace[0]));
index 98d357a..0f4f08d 100644 (file)
@@ -507,7 +507,7 @@ void Assembler::link(QV4::Function *vmFunc)
 
     static bool showCode = !qgetenv("SHOW_CODE").isNull();
     if (showCode) {
-#if OS(LINUX)
+#if OS(LINUX) && !defined(Q_OS_ANDROID)
         char* disasmOutput = 0;
         size_t disasmLength = 0;
         FILE* disasmStream = open_memstream(&disasmOutput, &disasmLength);
@@ -536,7 +536,7 @@ void Assembler::link(QV4::Function *vmFunc)
         vmFunc->codeRef = linkBuffer.finalizeCodeWithDisassembly("%s", name.data());
 
         WTF::setDataFile(stderr);
-#if OS(LINUX) || OS(MAC_OS_X)
+#if (OS(LINUX) && !defined(Q_OS_ANDROID)) || OS(MAC_OS_X)
 #  if OS(MAC_OS_X)
         char *disasmOutput = memStream.buf.data();
 #  endif
index 88cf114..ff99a0a 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "qv4unwindhelper_p.h"
 #include "qv4functionobject_p.h"
+#include "qv4function_p.h"
 #include <wtf/Platform.h>
 
 #include <QMap>
@@ -13,8 +14,8 @@
 
 #if USE(LIBUNWIND_DEBUG)
 #include <libunwind.h>
-#endif
 #include <execinfo.h>
+#endif
 
 namespace QV4 {