From b5e9130c44a28ff7891f124865c2f322729b834a Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 23 Apr 2021 11:47:46 +0200 Subject: QtGlobal: check the Qt fixed size integers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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 Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qglobal.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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::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 -- cgit v1.2.3