app-misc/gnome-commander: 1.3.0.99 - adjust dep for app-doc/chmlib -> dev-libs/chmlib...
[gentoo-soor-overlay.git] / x11-libs / qt / files / qt-3.3.8-mips.patch
blob1f70900f7bf49c6f5c67d703e3b781ed73a7756b
1 Bug 210551.
2 Fix compilation on mips
4 Original commit message by Christopher Martin, debian bug 342545.
6 * Add a patch, courtesy of Steve Langasek, that fixes
7 qt-x11-free's longstanding intermittent FTBFS on hppa, caused
8 by "the bogus assumption in src/tools/qlocale.cpp that a
9 char[] can be cast to a double *." (Closes: #342545)
11 --- qt-x11-free-3.3.6.orig/src/tools/qlocale.cpp
12 +++ qt-x11-free-3.3.6/src/tools/qlocale.cpp
13 @@ -122,13 +122,24 @@
14 #endif
16 // We can't rely on -NAN, since all operations on a NAN should return a NAN.
17 +static double be_neg_nan;
18 +static double le_neg_nan;
19 static const unsigned char be_neg_nan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
20 static const unsigned char le_neg_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
21 +static bool neg_nan_init = false;
23 static inline double negNan()
25 + if (!neg_nan_init)
26 + {
27 + memcpy(&be_neg_nan,be_neg_nan_bytes,sizeof(be_neg_nan_bytes));
28 + memcpy(&le_neg_nan,le_neg_nan_bytes,sizeof(le_neg_nan_bytes));
29 + neg_nan_init = true;
30 + }
31 return (ByteOrder == BigEndian ?
32 - *((const double *) be_neg_nan_bytes) :
33 - *((const double *) le_neg_nan_bytes));
34 + be_neg_nan :
35 + le_neg_nan);
39 // Sizes as defined by the ISO C99 standard - fallback