qt4-libs: fix build with gcc9

from https://aur.archlinux.org/packages/qt4/
This commit is contained in:
markd 2019-07-03 10:04:23 +00:00
parent bf4902a2f6
commit d87b8c4684
2 changed files with 52 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.114 2018/01/17 18:37:34 markd Exp $
$NetBSD: distinfo,v 1.115 2019/07/03 10:04:23 markd Exp $
SHA1 (qt-everywhere-opensource-src-4.8.7.tar.gz) = 76aef40335c0701e5be7bb3a9101df5d22fe3666
RMD160 (qt-everywhere-opensource-src-4.8.7.tar.gz) = afb5e5a99388e6429faca59cb5000054feffd166
@ -73,6 +73,7 @@ SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_graphics_filters_arm_FEG
SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_graphics_filters_arm_FELightingNEON.cpp) = a0a3d9d066aa6ae3c42cee198287b10e46e7f25d
SHA1 (patch-src_3rdparty_webkit_Source_WebCore_platform_qt_PlatformKeyboardEventQt.cpp) = b28cf71983f8e71b82b1c634a10b3898ca13ede5
SHA1 (patch-src_3rdparty_webkit_Source_WebKit2_DerivedSources.pro) = 7ae5feb79efd0836b74000e183b96f5775fd3043
SHA1 (patch-src_corelib_global_qglobal.h) = 508cc9ae19eaa3144bfd676822a22add6a2e4127
SHA1 (patch-src_corelib_io_io.pri) = cde98927b524c92fae1e053c2359e77bde2c240a
SHA1 (patch-src_corelib_io_qfilesystemwatcher.cpp) = bb16b95d20286b1aa069dc25843d7e0067cc0268
SHA1 (patch-src_corelib_thread_qthread__unix.cpp) = 67fbdc29d6da0aa7309a7aeb653a5abf10bd4d78

View file

@ -0,0 +1,50 @@
$NetBSD: patch-src_corelib_global_qglobal.h,v 1.1 2019/07/03 10:04:24 markd Exp $
Fix for gcc9
--- src/corelib/global/qglobal.h 2015-05-07 17:14:48.000000000 +0300
+++ src/corelib/global/qglobal.h 2019-05-28 20:04:15.689744432 +0300
@@ -2480,26 +2480,35 @@
typedef uint Flags;
#define Q_DECLARE_OPERATORS_FOR_FLAGS(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;
};
-#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;}))
+// 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_.control && _container_.i != _container_.e; \
+ ++_container_.i, _container_.control ^= 1) \
+for (variable = *_container_.i; _container_.control; _container_.control = 0)
#else
struct QForeachContainerBase {};