summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-04-23 11:47:46 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-04-23 20:59:45 +0200
commitb5e9130c44a28ff7891f124865c2f322729b834a (patch)
tree37c1a78448c2db23d741aaa7ad34bcac59eec905 /src/corelib/global/qglobal.cpp
parent22e967c3049608f82abd32a0beb0b4b36ee134bf (diff)
QtGlobal: check the Qt fixed size integers
"Just in case", together with all the others platform checks we have in qglobal.cpp, check that we're not accidentally breaking our type aliases for fixed size integers. Change-Id: Iaa9438741b3a7e89f3c458763c7d222ef2abe961 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 342fecb300..3e21d41bbb 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -173,6 +173,12 @@ static_assert(sizeof(size_t) == sizeof(void *), "size_t and a pointer don't have
static_assert(sizeof(size_t) == sizeof(qsizetype)); // implied by the definition
static_assert((std::is_same<qsizetype, qptrdiff>::value));
+// Check that our own typedefs are not broken.
+static_assert(sizeof(qint8) == 1, "Internal error, qint8 is misdefined");
+static_assert(sizeof(qint16)== 2, "Internal error, qint16 is misdefined");
+static_assert(sizeof(qint32) == 4, "Internal error, qint32 is misdefined");
+static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
+
/*!
\class QFlag
\inmodule QtCore