summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-03-30 08:28:42 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-03-30 08:28:42 (GMT)
commit571454cef27b8e377806ce25f457db0902e4b262 (patch)
tree9688ea234b375549a60a4addabd90ede5e7ddc3a /src/corelib/kernel
parentb3a2c210973a77d1517d017637a3d6ef849f4089 (diff)
parent9748269cb58266fdfdac2c8820dad8c473dcf512 (diff)
downloadQt-571454cef27b8e377806ce25f457db0902e4b262.zip
Qt-571454cef27b8e377806ce25f457db0902e4b262.tar.gz
Qt-571454cef27b8e377806ce25f457db0902e4b262.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into windows-7-multitouch
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.cpp20
-rw-r--r--src/corelib/kernel/qtranslator.cpp5
2 files changed, 19 insertions, 6 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 05015c0..0e632db 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2179,13 +2179,29 @@ void QObject::deleteLater()
Signals and slots
*****************************************************************************/
+// list taken from http://en.wikipedia.org/wiki/Thread-Specific_Storage
+#if defined(Q_OS_WIN)
+// Some people like to dynamically load Qt (LoadLibrary), so we can't use this
+#elif defined(Q_CC_GNU) && !defined(Q_WS_QWS)
+// GCC has warnings about this not being ported to all archs
+// So we only enable what we know to work. More archs can be added later, like Mac
+# if defined(Q_OS_LINUX) && (defined(QT_ARCH_I386) || defined(QT_ARCH_X86_64) || defined(QT_ARCH_IA64))
+# define THRSPECIFIC __thread __attribute__((tls_model("local-dynamic")))
+# endif
+#elif defined(Q_CC_SUN) || defined(Q_CC_INTEL) || defined(Q_CC_XLC)
+# define THRSPECIFIC __thread
+#endif
+
+#ifndef THRSPECIFIC
+# define THRSPECIFIC
+#endif
const int flagged_locations_count = 2;
-static const char* flagged_locations[flagged_locations_count] = {0};
+static THRSPECIFIC const char* flagged_locations[flagged_locations_count] = {0};
const char *qFlagLocation(const char *method)
{
- static int idx = 0;
+ static THRSPECIFIC int idx = 0;
flagged_locations[idx] = method;
idx = (idx+1) % flagged_locations_count;
return method;
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index cdddf36..77d6599 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -95,8 +95,7 @@ static bool match(const uchar* found, const char* target, uint len)
// (normalize it to be without the zero-terminating symbol)
if (len > 0 && found[len-1] == '\0')
--len;
- // 0 means anything, "" means empty
- return !found || (qstrncmp((const char *)found, target, len) == 0 && target[len] == '\0');
+ return (memcmp(found, target, len) == 0 && target[len] == '\0');
}
static uint elfHash(const char *name)
@@ -765,8 +764,6 @@ void QTranslatorPrivate::clear()
}
/*!
- \since 4.5
-
Returns the translation for the key (\a context, \a sourceText,
\a disambiguation). If none is found, also tries (\a context, \a
sourceText, ""). If that still fails, returns an empty string.