summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-31 11:40:17 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-31 11:40:53 (GMT)
commit18d9902a2c5650e48a33b09ef68596479e7cb9ff (patch)
tree053a92cb5057288baefb165f7bae67ea89daa53a /src/corelib
parentfbbd7f9a27216dc66a77a064179a4775ce9fb91e (diff)
downloadQt-18d9902a2c5650e48a33b09ef68596479e7cb9ff.zip
Qt-18d9902a2c5650e48a33b09ef68596479e7cb9ff.tar.gz
Qt-18d9902a2c5650e48a33b09ef68596479e7cb9ff.tar.bz2
Fix compilation: add #include <new> if placement new is used
I'm not sure this is the proper fix, though. xlC 7 complains with: "/usr/vacpp/include/new", line 97.10: 1540-1298 (I) "void *operator new(size_t, void *) throw()" needs to be declared in the containing scope to be found by name lookup. Also add some calculations to the padding in the data structure. Reviewed-by: Trust Me
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qcontiguouscache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index 0020d22..7221925 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -44,6 +44,7 @@
#include <QtCore/qatomic.h>
#include <limits.h>
+#include <new>
QT_BEGIN_HEADER
@@ -76,6 +77,12 @@ struct QContiguousCacheTypedData
int start;
int offset;
uint sharable : 1;
+ // uint unused : 31;
+
+ // total is 24 bytes (HP-UX aCC: 40 bytes)
+ // the next entry is already aligned to 8 bytes
+ // there will be an 8 byte gap here if T requires 16-byte alignment
+ // (such as long double on 64-bit platforms, __int128, __float128)
T array[1];
};