summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h11
-rw-r--r--src/corelib/global/qglobal.h1
-rw-r--r--src/corelib/global/qlogging.cpp29
-rw-r--r--src/corelib/global/qnamespace.qdoc7
4 files changed, 33 insertions, 15 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index fa8a529d0c..0ca67df1e2 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -173,7 +173,11 @@
# else
# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
# endif
-# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
+# if __has_builtin(__builtin_assume)
+# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
+# else
+# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
+# endif
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
# if !defined(__has_extension)
# /* Compatibility with older Clang versions */
@@ -545,7 +549,10 @@
# define Q_COMPILER_UNRESTRICTED_UNIONS
# endif
# if __INTEL_COMPILER >= 1500
-# define Q_COMPILER_CONSTEXPR
+# if __INTEL_COMPILER * 100 + __INTEL_COMPILER_UPDATE >= 150001
+// the bug mentioned above is fixed in 15.0.1
+# define Q_COMPILER_CONSTEXPR
+# endif
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
# define Q_COMPILER_INHERITING_CONSTRUCTORS
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 554c5b658a..a171f0894b 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -882,6 +882,7 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
/* make use of decltype or GCC's __typeof__ extension */
template <typename T>
class QForeachContainer {
+ QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
public:
inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
const T c;
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index d8f5b59c63..d9d21c535c 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -78,11 +78,12 @@
#ifndef QT_BOOTSTRAPPED
#if !defined QT_NO_REGULAREXPRESSION
-# if (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
+# ifdef __UCLIBC__
+# if __UCLIBC_HAS_BACKTRACE__
+# define QLOGGING_HAVE_BACKTRACE
+# endif
+# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
# define QLOGGING_HAVE_BACKTRACE
-# include <qregularexpression.h>
-# include <cxxabi.h>
-# include <execinfo.h>
# endif
#endif
@@ -116,6 +117,12 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid()
return qintptr(QThread::currentThreadId());
}
#endif
+
+#ifdef QLOGGING_HAVE_BACKTRACE
+# include <qregularexpression.h>
+# include <cxxabi.h>
+# include <execinfo.h>
+#endif
#endif // !QT_BOOTSTRAPPED
#include <stdio.h>
@@ -998,7 +1005,7 @@ QMessagePattern::QMessagePattern()
QMessagePattern::~QMessagePattern()
{
- for (int i = 0; literals[i] != 0; ++i)
+ for (int i = 0; literals[i]; ++i)
delete [] literals[i];
delete [] literals;
literals = 0;
@@ -1008,8 +1015,12 @@ QMessagePattern::~QMessagePattern()
void QMessagePattern::setPattern(const QString &pattern)
{
+ if (literals) {
+ for (int i = 0; literals[i]; ++i)
+ delete [] literals[i];
+ delete [] literals;
+ }
delete [] tokens;
- delete [] literals;
// scanner
QList<QString> lexemes;
@@ -1285,13 +1296,13 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
message.append(QString::number(qlonglong(QThread::currentThread()->currentThread()), 16));
#ifdef QLOGGING_HAVE_BACKTRACE
} else if (token == backtraceTokenC) {
- QVarLengthArray<void*, 32> buffer(15 + pattern->backtraceDepth);
+ QVarLengthArray<void*, 32> buffer(7 + pattern->backtraceDepth);
int n = backtrace(buffer.data(), buffer.size());
if (n > 0) {
- QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data(), n));
int numberPrinted = 0;
for (int i = 0; i < n && numberPrinted < pattern->backtraceDepth; ++i) {
- QString trace = QString::fromLatin1(strings.data()[i]);
+ QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
+ QString trace = QString::fromLatin1(strings.data()[0]);
// The results of backtrace_symbols looks like this:
// /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
// The offset and function name are optional.
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 1be83caa06..ba3a621751 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -498,7 +498,7 @@
\value TextExpandTabs Makes the U+0009 (ASCII tab) character move to
the next tab stop.
\value TextShowMnemonic Displays the string "\&P" as \underline{P}
- (see QButton for an example). For an ampersand, use "\&\&".
+ For an ampersand, use "\&\&".
\value TextWordWrap Breaks lines at appropriate points, e.g. at word
boundaries.
\value TextWrapAnywhere Breaks lines anywhere, even within words.
@@ -902,8 +902,7 @@
on QWidget::contentsRect(). This is set by the widget's author.
\value WA_LayoutUsesWidgetRect Ignore the layout item rect from the style
- when laying out this widget with QLayout. This makes a difference in
- QMacStyle and QPlastiqueStyle for some widgets.
+ when laying out this widget with QLayout.
\value WA_MacNoClickThrough When a widget that has this attribute set
is clicked, and its window is inactive, the click will make the window
@@ -1162,7 +1161,7 @@
_NET_WM_WINDOW_TYPE X11 window property. See
http://standards.freedesktop.org/wm-spec/ for more details. This
attribute has no effect on non-X11 platforms. \b Note: Qt
- automatically sets this attribute for QMenus added to a QMenuBar.
+ automatically sets this attribute for QMenu objects added to a QMenuBar.
\value WA_X11NetWmWindowTypePopupMenu Adds _NET_WM_WINDOW_TYPE_POPUP_MENU
to the window's _NET_WM_WINDOW_TYPE X11 window property. See