- fixed: The compile context for constant evaluation did not initialize its Version member.

This commit is contained in:
Christoph Oelckers 2022-08-03 08:44:38 +02:00
commit 5cee2b5803
7 changed files with 19 additions and 19 deletions

View file

@ -12,19 +12,19 @@ struct VersionInfo
uint16_t minor;
uint32_t revision;
bool operator <=(const VersionInfo& o) const
constexpr bool operator <=(const VersionInfo& o) const
{
return o.major > this->major || (o.major == this->major && o.minor > this->minor) || (o.major == this->major && o.minor == this->minor && o.revision >= this->revision);
}
bool operator >=(const VersionInfo& o) const
constexpr bool operator >=(const VersionInfo& o) const
{
return o.major < this->major || (o.major == this->major && o.minor < this->minor) || (o.major == this->major && o.minor == this->minor && o.revision <= this->revision);
}
bool operator > (const VersionInfo& o) const
constexpr bool operator > (const VersionInfo& o) const
{
return o.major < this->major || (o.major == this->major && o.minor < this->minor) || (o.major == this->major && o.minor == this->minor && o.revision < this->revision);
}
bool operator < (const VersionInfo& o) const
constexpr bool operator < (const VersionInfo& o) const
{
return o.major > this->major || (o.major == this->major && o.minor > this->minor) || (o.major == this->major && o.minor == this->minor && o.revision > this->revision);
}
@ -32,7 +32,7 @@ struct VersionInfo
};
// Cannot be a constructor because Lemon would puke on it.
inline VersionInfo MakeVersion(unsigned int ma, unsigned int mi, unsigned int re = 0)
constexpr VersionInfo MakeVersion(unsigned int ma, unsigned int mi, unsigned int re = 0)
{
return{ (uint16_t)ma, (uint16_t)mi, (uint32_t)re };
}