Fix support Visual Studio 2015.

This commit is contained in:
Roman Telezhynskyi 2022-09-01 10:11:44 +03:00
parent 3e8c45737f
commit daf7574f39
3 changed files with 4 additions and 7 deletions

View File

@ -40,7 +40,7 @@
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
#include "../ifc/exception/vexceptionobjecterror.h" #include "../ifc/exception/vexceptionobjecterror.h"
#if defined(Q_CC_MSVC) && _MSC_VER <= 1900 #if defined(__cpp_constexpr) && __cpp_constexpr-0 < 201304
const qreal VAbstractCurve::minLength = ToPixel(1, Unit::Mm); const qreal VAbstractCurve::minLength = ToPixel(1, Unit::Mm);
#endif #endif

View File

@ -112,15 +112,12 @@ public:
void SetAliasSuffix(const QString &aliasSuffix) override; void SetAliasSuffix(const QString &aliasSuffix) override;
#if defined(Q_CC_MSVC) #if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304
#if _MSC_VER > 1900
static constexpr qreal minLength = ToPixel(1, Unit::Mm); static constexpr qreal minLength = ToPixel(1, Unit::Mm);
#else #else
static const qreal minLength; static const qreal minLength;
#endif #endif
#else
static constexpr qreal minLength = ToPixel(1, Unit::Mm);
#endif
protected: protected:
virtual void CreateName() =0; virtual void CreateName() =0;
virtual void CreateAlias() =0; virtual void CreateAlias() =0;

View File

@ -477,7 +477,7 @@ auto VEllipticalArc::GetPoints() const -> QVector<QPointF>
const QPointF center = VAbstractArc::GetCenter().toQPointF(); const QPointF center = VAbstractArc::GetCenter().toQPointF();
// Don't work with 0 radius. Always make it bigger than 0. // Don't work with 0 radius. Always make it bigger than 0.
constexpr qreal threshold = ToPixel(0.001, Unit::Mm); Q_RELAXED_CONSTEXPR qreal threshold = ToPixel(0.001, Unit::Mm);
qreal radius1 = qMax(d->radius1, threshold); qreal radius1 = qMax(d->radius1, threshold);
qreal radius2 = qMax(d->radius2, threshold); qreal radius2 = qMax(d->radius2, threshold);
qreal max = qMax(d->radius1, d->radius2); qreal max = qMax(d->radius1, d->radius2);