diff options
author | Marc Mutz <[email protected]> | 2025-06-25 08:05:50 +0200 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2025-07-01 13:56:05 +0200 |
commit | 1b1cb5bf666df76be876e593da04125f21c7b30b (patch) | |
tree | 13569610dd6328a2440e9760e04fe0d3496b4d61 | |
parent | 6eb65b75fe3cbc0ea7092f80b5a1d7280400e2a0 (diff) |
QQuaternion: fix MingW "redeclared without dllimport attribute" error
I don't know why, but after years of no changes to the header, the CI
on 6.5 started to throw the dreaded
qquaternion.h:138:8: error: 'QQuaternion::QQuaternion()' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
Fix by plastering the class with inline keywords. This just goes to
show that separating definition and declaration of inline functions
(and exporting non-polymorphic classes wholesale) is usually a bad
idea.
Remove the inline keywords from the definitions to order to use the
linker on all platforms to verify we marked all functions inline that
are.
Later releases are unaffected, because
f9f1272e7c438b79591032877f2b386af8085c3f plastered the class with
constexpr, which implies inline.
Manual conflict resolution for dev:
- there were three inline keywords left outside the class after
f9f1272e7c438b79591032877f2b386af8085c3f, this patch removes them,
so mark it as a cherry-pick of the 6.5 change, which did the same
Pick-to: 6.10 6.9 6.8
Change-Id: I5f044e4aae8e31173c0717d4b70d53fece99b927
Reviewed-by: Volker Hilsheimer <[email protected]>
(cherry picked from commit fccb455a4f94e5bc95ba6ad54a46fa71439314bb)
Reviewed-by: Daniel Smith <[email protected]>
-rw-r--r-- | src/gui/math3d/qquaternion.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index 7fb153063c5..b53caafea6d 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -311,21 +311,21 @@ inline QVector3D operator*(const QQuaternion &quaternion, const QVector3D &vec) return quaternion.rotatedVector(vec); } -inline void QQuaternion::getAxisAndAngle(QVector3D *axis, float *angle) const +void QQuaternion::getAxisAndAngle(QVector3D *axis, float *angle) const { float aX, aY, aZ; getAxisAndAngle(&aX, &aY, &aZ, angle); *axis = QVector3D(aX, aY, aZ); } -inline QVector3D QQuaternion::toEulerAngles() const +QVector3D QQuaternion::toEulerAngles() const { float pitch, yaw, roll; getEulerAngles(&pitch, &yaw, &roll); return QVector3D(pitch, yaw, roll); } -inline QQuaternion QQuaternion::fromEulerAngles(const QVector3D &eulerAngles) +QQuaternion QQuaternion::fromEulerAngles(const QVector3D &eulerAngles) { return QQuaternion::fromEulerAngles(eulerAngles.x(), eulerAngles.y(), eulerAngles.z()); } |