summaryrefslogtreecommitdiff
path: root/source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2019-05-04 01:29:20 +0000
committerEric Hameleers <alien@slackware.com>2019-05-04 08:59:47 +0200
commit125048ad7d212c1f226b709697505b0ee6a079e4 (patch)
tree4d930a5b4d508518dedfc25375251fe24dda7b92 /source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch
parentfe8c535f50697455b55b8ded880317ac33910704 (diff)
downloadcurrent-125048ad7d212c1f226b709697505b0ee6a079e4.tar.gz
Sat May 4 01:29:20 UTC 201920190504012920
d/gcc-9.1.0-x86_64-1.txz: Upgraded. d/gcc-brig-9.1.0-x86_64-1.txz: Upgraded. d/gcc-g++-9.1.0-x86_64-1.txz: Upgraded. d/gcc-gfortran-9.1.0-x86_64-1.txz: Upgraded. d/gcc-gnat-9.1.0-x86_64-1.txz: Upgraded. d/gcc-go-9.1.0-x86_64-1.txz: Upgraded. Shared library .so-version bump. d/gcc-objc-9.1.0-x86_64-1.txz: Upgraded. d/libtool-2.4.6-x86_64-11.txz: Rebuilt. Recompiled to update embedded GCC version number. d/llvm-8.0.0-x86_64-2.txz: Rebuilt. Recompiled with -DLLVM_INSTALL_UTILS=ON. Thanks to Lockywolf. d/swig-4.0.0-x86_64-1.txz: Upgraded. l/glib2-2.60.2-x86_64-1.txz: Upgraded. l/qt-4.8.7-x86_64-13.txz: Rebuilt. Patched to fix FTBFS with gcc9 (also fixes FTBFS with qtscriptgenerator and possibly other projects that use qt4).
Diffstat (limited to 'source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch')
-rw-r--r--source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch b/source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch
new file mode 100644
index 00000000..836dc13a
--- /dev/null
+++ b/source/l/qt/patches/qt-everywhere-opensource-src-4.8.7-qforeach.patch
@@ -0,0 +1,40 @@
+--- a/src/corelib/global/qglobal.h
++++ b/src/corelib/global/qglobal.h
+@@ -2482,22 +2482,32 @@ typedef uint Flags;
+
+ #endif /* Q_NO_TYPESAFE_FLAGS */
+
+-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
++#if (defined(Q_CC_GNU) && !defined(Q_CC_RVCT))
+ /* make use of typeof-extension */
+ template <typename T>
+ class QForeachContainer {
+ public:
+- inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
++ inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
+ const T c;
+ int brk;
+ typename T::const_iterator i, e;
++ int control;
+ };
+
++// Explanation of the control word:
++// - it's initialized to 1
++// - that means both the inner and outer loops start
++// - if there were no breaks, at the end of the inner loop, it's set to 0, which
++// causes it to exit (the inner loop is run exactly once)
++// - at the end of the outer loop, it's inverted, so it becomes 1 again, allowing
++// the outer loop to continue executing
++// - if there was a break inside the inner loop, it will exit with control still
++// set to 1; in that case, the outer loop will invert it to 0 and will exit too
+ #define Q_FOREACH(variable, container) \
+ for (QForeachContainer<__typeof__(container)> _container_(container); \
+- !_container_.brk && _container_.i != _container_.e; \
+- __extension__ ({ ++_container_.brk; ++_container_.i; })) \
+- for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;}))
++ _container_.control && _container_.i != _container_.e; \
++ ++_container_.i, _container_.control ^= 1) \
++ for (variable = *_container_.i; _container_.control; _container_.control = 0)
+
+ #else
+