PKGBUILDs/extra/qt3/arm_no_packed.patch
michael 97b389bcdb ARM cannot bind references to packed fields.
There is no possible implementation of QChar.unicode() returning a int&.
Replace with unicodep() returning int*. The allows athe code to compile.
To be determined if the reference access ever work on ARM as it cannot make the unaligned access.
2012-11-23 08:00:45 +01:00

69 lines
2.2 KiB
Diff

--- a/src/qt-x11-free-3.3.8b/src/tools/qglobal.h
+++ b/src/qt-x11-free-3.3.8b/src/tools/qglobal.h
@@ -323,6 +323,13 @@
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
# define Q_NO_PACKED_REFERENCE
# endif
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 0
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 7
+# define Q_NO_PACKED_ACCESS
+# else
+# define Q_NO_PACKED_POINTERS
+# endif
+# endif
# endif
# if !defined(__EXCEPTIONS)
# define Q_NO_EXCEPTIONS
--- a/src/qt-x11-free-3.3.8b/src/tools/qlocale.cpp
+++ b/src/qt-x11-free-3.3.8b/src/tools/qlocale.cpp
@@ -3293,7 +3293,11 @@ QString QLocalePrivate::doubleToString(double d,
if (zero().unicode() != '0') {
for (uint i = 0; i < digits.length(); ++i)
+#ifdef Q_NO_PACKED_ACCESS
+ *digits.ref(i).unicodep() += zero().unicode() - '0';
+#else
digits.ref(i).unicode() += zero().unicode() - '0';
+#endif
}
bool always_show_decpt = flags & Alternate;
--- a/src/qt-x11-free-3.3.8b/src/tools/qstring.cpp
+++ b/src/qt-x11-free-3.3.8b/src/tools/qstring.cpp
@@ -1933,7 +1933,11 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
if (field_width > 0) { // left padded
for (uint i = 0; i < pad_chars; ++i)
+#ifdef Q_NO_PACKED_ACCESS
+ *(rc++)->unicodep() = ' ';
+#else
(rc++)->unicode() = ' ';
+#endif
}
if (locale_arg) {
@@ -1947,7 +1951,11 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f
if (field_width < 0) { // right padded
for (uint i = 0; i < pad_chars; ++i)
+#ifdef Q_NO_PACKED_ACCESS
+ *(rc++)->unicodep() = ' ';
+#else
(rc++)->unicode() = ' ';
+#endif
}
if (++repl_cnt == d.occurrences) {
--- a/src/qt-x11-free-3.3.8b/src/tools/qstring.h
+++ b/src/qt-x11-free-3.3.8b/src/tools/qstring.h
@@ -199,6 +199,10 @@ public:
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
+#elif defined Q_NO_PACKED_POINTERS
+ ushort &unicode() { ushort& tmp = ucs; return tmp; }
+#elif defined Q_NO_PACKED_ACCESS
+ ushort *unicodep() { return &ucs; }
#else
ushort &unicode() { return ucs; }
#endif