summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/archdetect.cpp6
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp13
2 files changed, 16 insertions, 3 deletions
diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp
index e35595e727..344c363031 100644
--- a/src/corelib/global/archdetect.cpp
+++ b/src/corelib/global/archdetect.cpp
@@ -83,10 +83,10 @@
# define ARCH_PROCESSOR "unknown"
#endif
-// endinanness
-#if defined(Q_LITTLE_ENDIAN)
+// endianness
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
# define ARCH_ENDIANNESS "little_endian"
-#elif defined(Q_BIG_ENDIAN)
+#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
# define ARCH_ENDIANNESS "big_endian"
#endif
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 0389ae7976..076e3eee1c 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -45,6 +45,8 @@
#include <QPair>
#include <QTextCodec>
+#include <QSysInfo>
+#include <QLatin1String>
class tst_QGlobal: public QObject
{
@@ -65,6 +67,7 @@ private slots:
void integerForSize();
void qprintable();
void qprintable_data();
+ void buildAbiEndianness();
};
void tst_QGlobal::qIsNull()
@@ -652,5 +655,15 @@ void tst_QGlobal::qprintable_data()
}
+void tst_QGlobal::buildAbiEndianness()
+{
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ QLatin1String endian("little_endian");
+#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
+ QLatin1String endian("big_endian");
+#endif
+ QVERIFY(QSysInfo::buildAbi().contains(endian));
+}
+
QTEST_APPLESS_MAIN(tst_QGlobal)
#include "tst_qglobal.moc"