This repository has been archived on 2024-11-07. You can view files and clone it, but cannot push or open issues or pull requests.
libqt3/libqt-3.3.8b-arm-gcc4.patch

40 lines
1.5 KiB
Diff

diff -urN qt-embedded-free-3.3.7.ori/src/tools/qglobal.h
qt-embedded-free-3.3.7/src/tools/qglobal.h
--- qt-embedded-free-3.3.7.ori/src/tools/qglobal.h 2006-10-19
16:25:01.000000000 +0200
+++ qt-embedded-free-3.3.7/src/tools/qglobal.h 2007-03-15
11:02:22.087570384 +0100
@@ -314,12 +314,16 @@
char, or short. We tell gcc to pack QChars to 16 bits, to avoid
QString bloat. However, gcc 3.4 doesn't allow us to create references to
members of a packed struct. (Pointers are OK, because then you
- supposedly know what you are doing.) */
+ supposedly know what you are doing.)
+ For gcc 4.0.2 pointers dont seem to be ok, */
# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((packed))
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
# define Q_NO_PACKED_REFERENCE
# endif
+# if __GNUC__ == 4 && __GNUC_MINOR__ >= 0
+# define Q_NO_PACKED_POINTERS
+# endif
# endif
# if !defined(__EXCEPTIONS)
# define Q_NO_EXCEPTIONS
diff -urN qt-embedded-free-3.3.7.ori/src/tools/qstring.h
qt-embedded-free-3.3.7/src/tools/qstring.h
--- qt-embedded-free-3.3.7.ori/src/tools/qstring.h 2006-10-19
16:25:03.000000000 +0200
+++ qt-embedded-free-3.3.7/src/tools/qstring.h 2007-03-15
11:05:46.890435616 +0100
@@ -195,6 +195,8 @@
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
+#elif defined Q_NO_PACKED_POINTERS
+ ushort &unicode() { return *((ushort*)&ucs); }
#else
ushort &unicode() { return ucs; }
#endif