aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@collabora.co.uk>2012-07-02 11:19:56 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-02 19:08:28 +0200
commit007204544c4fd8c75b6c61d240f203a9cabc7591 (patch)
treee51e23fb945f229e06269f6b166e0a8af07ed22e /src/quick/scenegraph
parent7572d2881ecf28f282fdd3129973f94ea319ed1a (diff)
android: don't unconditionally use execinfo.h
android (a superset or subset, depending on your POV) of Linux doesn't seem to have execinfo.h, so disable it there. also simplify the conditional a little so we don't have to alter this all over the place if the platform support changes in the future. Change-Id: I937b04f363dfff2b10e1696f11e67d4ba55b3b06 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 816b0416a5..c3f15cc568 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -48,7 +48,19 @@
#include <private/qqmlprofilerservice_p.h>
#include <private/qqmlglobal_p.h>
-#if !defined(QT_NO_DEBUG) && (defined(Q_OS_LINUX) || defined(Q_OS_MAC))
+#if defined(Q_OS_LINUX) && !defined(Q_OS_LINUX_ANDROID)
+#define CAN_BACKTRACE_EXECINFO
+#endif
+
+#if defined(Q_OS_MAC)
+#define CAN_BACKTRACE_EXECINFO
+#endif
+
+#if defined(QT_NO_DEBUG)
+#undef CAN_BACKTRACE_EXECINFO
+#endif
+
+#if defined(CAN_BACKTRACE_EXECINFO)
#include <execinfo.h>
#include <QHash>
#endif
@@ -94,7 +106,7 @@ inline static void qt_debug_print_texture_count()
qDebug("Number of leaked textures: %i", qt_debug_texture_count);
qt_debug_texture_count = -1;
-#if defined(Q_OS_LINUX) || defined (Q_OS_MAC)
+#if defined(CAN_BACKTRACE_EXECINFO)
if (qmlDebugLeakBacktrace()) {
while (!qt_debug_allocated_textures.isEmpty()) {
QHash<QSGTexture*, SGTextureTraceItem*>::Iterator it = qt_debug_allocated_textures.begin();
@@ -124,7 +136,7 @@ inline static void qt_debug_print_texture_count()
inline static void qt_debug_add_texture(QSGTexture* texture)
{
-#if defined(Q_OS_LINUX) || defined (Q_OS_MAC)
+#if defined(CAN_BACKTRACE_EXECINFO)
if (qmlDebugLeakBacktrace()) {
SGTextureTraceItem* item = new SGTextureTraceItem;
item->backTraceSize = backtrace(item->backTrace, BACKTRACE_SIZE);
@@ -145,7 +157,7 @@ inline static void qt_debug_add_texture(QSGTexture* texture)
static void qt_debug_remove_texture(QSGTexture* texture)
{
-#if defined(Q_OS_LINUX) || defined (Q_OS_MAC)
+#if defined(CAN_BACKTRACE_EXECINFO)
if (qmlDebugLeakBacktrace()) {
SGTextureTraceItem* item = qt_debug_allocated_textures.value(texture, 0);
if (item) {