From: Robin Burchell Date: Mon, 2 Jul 2012 09:19:56 +0000 (+0200) Subject: android: don't unconditionally use execinfo.h X-Git-Tag: upstream/5.2.1~1531 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=007204544c4fd8c75b6c61d240f203a9cabc7591;p=platform%2Fupstream%2Fqtdeclarative.git 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 Reviewed-by: Gunnar Sletta --- diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index 816b041..c3f15cc 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -48,7 +48,19 @@ #include #include -#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 #include #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::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) {