diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-16 07:16:17 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-16 07:16:17 (GMT) |
commit | c9a89b253176547901e11d27c042983a65f43b1f (patch) | |
tree | e3d39e3033d462b51edd39d889a61b7dca9b81d4 /src/corelib/global | |
parent | bb8142436bacf5a4fa31880b58a8b3b6bc7b4d5b (diff) | |
parent | 2bfd1b35482a45370c49fec15d056322f35c3176 (diff) | |
download | Qt-c9a89b253176547901e11d27c042983a65f43b1f.zip Qt-c9a89b253176547901e11d27c042983a65f43b1f.tar.gz Qt-c9a89b253176547901e11d27c042983a65f43b1f.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (62 commits)
Use native locale aware string comparison on Symbian.
Temporary fix for regression in QSslCertificate::fromPath()
doc: Added more DITA output to the XML generator
Fix symbian building of TARGET with a slash
Fix a minor typo in QAbstractItemModel's documentation.
QXmlSchema: allow usage of xsd:all
QSslSocket: fix build for MinGW and VS 2005
Fix symbian-abld build failure with bearer plugins
remove certificate bundle
make QSslSocket::systemCaCertificates() use system certs
Adjusted RegExp in QSslCertificate::fromPath()
Fix QSystemTrayIcon::supportsMessages() on Windows
Use NIM_SETVERSION to get the latest behavior
Cleanup obsolete stuff
doc: Added DITA XML generator
Fixed a broken merge.
Changed the way we detect touch screen on Windows.
Fixed error deploying qsymbianbearer.qtplugin on Symbian.
Revert "Attempt to fix build failure on Symbian."
Attempt to fix build failure on Symbian.
...
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qendian.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index 107854c..d53504a 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -44,6 +44,14 @@ #include <QtCore/qglobal.h> +#ifdef Q_OS_LINUX +# include <features.h> +#endif + +#ifdef __GLIBC__ +#include <byteswap.h> +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -264,6 +272,21 @@ template <> inline qint16 qFromBigEndian<qint16>(const uchar *src) * and it is therefore a bit more convenient and in most cases more efficient. */ template <typename T> T qbswap(T source); + +#ifdef __GLIBC__ +template <> inline quint64 qbswap<quint64>(quint64 source) +{ + return bswap_64(source); +} +template <> inline quint32 qbswap<quint32>(quint32 source) +{ + return bswap_32(source); +} +template <> inline quint16 qbswap<quint16>(quint16 source) +{ + return bswap_16(source); +} +#else template <> inline quint64 qbswap<quint64>(quint64 source) { return 0 @@ -292,6 +315,7 @@ template <> inline quint16 qbswap<quint16>(quint16 source) | ((source & 0x00ff) << 8) | ((source & 0xff00) >> 8) ); } +#endif // __GLIBC__ // signed specializations template <> inline qint64 qbswap<qint64>(qint64 source) |