pkgsrc/x11/qt3-libs/patches/patch-ch
tsutsui ce66ab519e Fix build failure on NetBSD/arm.
patch-ad:
 src/tools/qglobal.h mentionss about Q_NO_PACKED_REFERENCE:
---
/* ARM gcc pads structs to 32 bits, even when they contain a single
   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.) */
#  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
---
 but it seems we also have to define it on gcc4.

patch-ch:
 Furthermore, it looks gcc4 also rejects implicit pointer casts, so
 add an explicit cast where the above Q_NO_PACKED_REFERENCE is referred.
2010-08-09 13:21:07 +00:00

13 lines
457 B
Text

$NetBSD: patch-ch,v 1.1 2010/08/09 13:21:07 tsutsui Exp $
--- src/tools/qstring.h.orig 2007-02-02 14:01:05.000000000 +0000
+++ src/tools/qstring.h
@@ -194,7 +194,7 @@
char latin1() const { return ucs > 0xff ? 0 : (char) ucs; }
ushort unicode() const { return ucs; }
#ifdef Q_NO_PACKED_REFERENCE
- ushort &unicode() { return *(&ucs); }
+ ushort &unicode() { return *(ushort *)(&ucs); }
#else
ushort &unicode() { return ucs; }
#endif