Remove some obsolete code
Those checks aren't required anymore for Qt 6. Change-Id: Ida9f93544f42cb03723659a81e0094aa0cf14799 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
e6c9ef72a9
commit
db61425225
|
|
@ -52,36 +52,6 @@ QT_BEGIN_NAMESPACE
|
|||
static_assert(std::is_standard_layout<QVector2D>::value, "QVector2D is supposed to be standard layout");
|
||||
static_assert(sizeof(QVector2D) == sizeof(float) * 2, "QVector2D is not supposed to have padding at the end");
|
||||
|
||||
// QVector2D used to be defined as class QVector2D { float x, y; };,
|
||||
// now instead it is defined as classs QVector2D { float v[2]; };.
|
||||
// Check that binary compatibility is preserved.
|
||||
// ### Qt 6: remove all of these checks.
|
||||
|
||||
namespace {
|
||||
|
||||
struct QVector2DOld
|
||||
{
|
||||
float x, y;
|
||||
};
|
||||
|
||||
struct QVector2DNew
|
||||
{
|
||||
float v[2];
|
||||
};
|
||||
|
||||
static_assert(std::is_standard_layout<QVector2DOld>::value, "Binary compatibility break in QVector2D");
|
||||
static_assert(std::is_standard_layout<QVector2DNew>::value, "Binary compatibility break in QVector2D");
|
||||
|
||||
static_assert(sizeof(QVector2DOld) == sizeof(QVector2DNew), "Binary compatibility break in QVector2D");
|
||||
|
||||
// requires a constexpr offsetof
|
||||
#if !defined(Q_CC_MSVC) || (_MSC_VER >= 1910)
|
||||
static_assert(offsetof(QVector2DOld, x) == offsetof(QVector2DNew, v) + sizeof(QVector2DNew::v[0]) * 0, "Binary compatibility break in QVector2D");
|
||||
static_assert(offsetof(QVector2DOld, y) == offsetof(QVector2DNew, v) + sizeof(QVector2DNew::v[0]) * 1, "Binary compatibility break in QVector2D");
|
||||
#endif
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
/*!
|
||||
\class QVector2D
|
||||
\brief The QVector2D class represents a vector or vertex in 2D space.
|
||||
|
|
|
|||
|
|
@ -54,38 +54,6 @@ QT_BEGIN_NAMESPACE
|
|||
static_assert(std::is_standard_layout<QVector3D>::value, "QVector3D is supposed to be standard layout");
|
||||
static_assert(sizeof(QVector3D) == sizeof(float) * 3, "QVector3D is not supposed to have padding at the end");
|
||||
|
||||
// QVector3D used to be defined as class QVector3D { float x, y, z; };,
|
||||
// now instead it is defined as classs QVector3D { float v[3]; };.
|
||||
// Check that binary compatibility is preserved.
|
||||
// ### Qt 6: remove all of these checks.
|
||||
|
||||
namespace {
|
||||
|
||||
struct QVector3DOld
|
||||
{
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
struct QVector3DNew
|
||||
{
|
||||
float v[3];
|
||||
};
|
||||
|
||||
static_assert(std::is_standard_layout<QVector3DOld>::value, "Binary compatibility break in QVector3D");
|
||||
static_assert(std::is_standard_layout<QVector3DNew>::value, "Binary compatibility break in QVector3D");
|
||||
|
||||
static_assert(sizeof(QVector3DOld) == sizeof(QVector3DNew), "Binary compatibility break in QVector3D");
|
||||
|
||||
// requires a constexpr offsetof
|
||||
#if !defined(Q_CC_MSVC) || (_MSC_VER >= 1910)
|
||||
static_assert(offsetof(QVector3DOld, x) == offsetof(QVector3DNew, v) + sizeof(QVector3DNew::v[0]) * 0, "Binary compatibility break in QVector3D");
|
||||
static_assert(offsetof(QVector3DOld, y) == offsetof(QVector3DNew, v) + sizeof(QVector3DNew::v[0]) * 1, "Binary compatibility break in QVector3D");
|
||||
static_assert(offsetof(QVector3DOld, z) == offsetof(QVector3DNew, v) + sizeof(QVector3DNew::v[0]) * 2, "Binary compatibility break in QVector3D");
|
||||
#endif
|
||||
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
/*!
|
||||
\class QVector3D
|
||||
\brief The QVector3D class represents a vector or vertex in 3D space.
|
||||
|
|
|
|||
|
|
@ -52,39 +52,6 @@ QT_BEGIN_NAMESPACE
|
|||
static_assert(std::is_standard_layout<QVector4D>::value, "QVector4D is supposed to be standard layout");
|
||||
static_assert(sizeof(QVector4D) == sizeof(float) * 4, "QVector4D is not supposed to have padding at the end");
|
||||
|
||||
// QVector4D used to be defined as class QVector4D { float x, y, z, w; };,
|
||||
// now instead it is defined as classs QVector4D { float v[4]; };.
|
||||
// Check that binary compatibility is preserved.
|
||||
// ### Qt 6: remove all of these checks.
|
||||
|
||||
namespace {
|
||||
|
||||
struct QVector4DOld
|
||||
{
|
||||
float x, y, z, w;
|
||||
};
|
||||
|
||||
struct QVector4DNew
|
||||
{
|
||||
float v[4];
|
||||
};
|
||||
|
||||
static_assert(std::is_standard_layout<QVector4DOld>::value, "Binary compatibility break in QVector4D");
|
||||
static_assert(std::is_standard_layout<QVector4DNew>::value, "Binary compatibility break in QVector4D");
|
||||
|
||||
static_assert(sizeof(QVector4DOld) == sizeof(QVector4DNew), "Binary compatibility break in QVector4D");
|
||||
|
||||
// requires a constexpr offsetof
|
||||
#if !defined(Q_CC_MSVC) || (_MSC_VER >= 1910)
|
||||
static_assert(offsetof(QVector4DOld, x) == offsetof(QVector4DNew, v) + sizeof(QVector4DNew::v[0]) * 0, "Binary compatibility break in QVector4D");
|
||||
static_assert(offsetof(QVector4DOld, y) == offsetof(QVector4DNew, v) + sizeof(QVector4DNew::v[0]) * 1, "Binary compatibility break in QVector4D");
|
||||
static_assert(offsetof(QVector4DOld, z) == offsetof(QVector4DNew, v) + sizeof(QVector4DNew::v[0]) * 2, "Binary compatibility break in QVector4D");
|
||||
static_assert(offsetof(QVector4DOld, w) == offsetof(QVector4DNew, v) + sizeof(QVector4DNew::v[0]) * 3, "Binary compatibility break in QVector4D");
|
||||
#endif
|
||||
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
/*!
|
||||
\class QVector4D
|
||||
\brief The QVector4D class represents a vector or vertex in 4D space.
|
||||
|
|
|
|||
Loading…
Reference in New Issue