Skip to content

Commit

Permalink
Fixed error: In the GNU C Library, "major" is defined by <sys/types.h>
Browse files Browse the repository at this point in the history
  • Loading branch information
Eism committed Mar 13, 2023
1 parent dbe7c6d commit 01137bd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions src/framework/global/types/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ Version::Version(const mu::String& versionStr)
setSuffix(versionStr.right(versionStr.size() - versionStr.indexOf(SUFFIX_DELIMITER) - 1));
}

int Version::major() const
int Version::majorVersion() const
{
return m_major;
}

int Version::minor() const
int Version::minorVersion() const
{
return m_minor;
}

int Version::patch() const
int Version::patchVersion() const
{
return m_patch;
}
Expand Down Expand Up @@ -148,15 +148,15 @@ mu::String Version::toString()

bool Version::operator <(const Version& other) const
{
if (m_major > other.major()) {
if (m_major > other.majorVersion()) {
return false;
} else if (m_major == other.major()) {
if (m_minor > other.minor()) {
} else if (m_major == other.majorVersion()) {
if (m_minor > other.minorVersion()) {
return false;
} else if (m_minor == other.minor()) {
if (m_patch > other.patch()) {
} else if (m_minor == other.minorVersion()) {
if (m_patch > other.patchVersion()) {
return false;
} else if (m_patch == other.patch()) {
} else if (m_patch == other.patchVersion()) {
if (m_suffix.isEmpty()) {
return false;
}
Expand Down Expand Up @@ -203,9 +203,9 @@ bool Version::operator <(const Version& other) const

bool Version::operator ==(const Version& other) const
{
return m_major == other.major()
&& m_minor == other.minor()
&& m_patch == other.patch()
return m_major == other.majorVersion()
&& m_minor == other.minorVersion()
&& m_patch == other.patchVersion()
&& m_suffix == other.suffix()
&& m_suffixVersion == other.suffixVersion();
}
Expand Down
6 changes: 3 additions & 3 deletions src/framework/global/types/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class Version
Version(int major, int minor = 0, int patch = 0, const String& suffix = String(), int suffixVersion = 0);
Version(const String& versionStr);

int major() const;
int minor() const;
int patch() const;
int majorVersion() const;
int minorVersion() const;
int patchVersion() const;
String suffix() const;
int suffixVersion() const;

Expand Down
2 changes: 1 addition & 1 deletion src/framework/musesampler/internal/libhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ struct MuseSamplerLibHandler
// Major versions have incompatible changes; we can only support
// interfaces we know about.
// TODO: check when we fixed the issue with version numbers not reporting? Was this ever an issue?
if (current.major() > maximumMajorVersion) {
if (current.majorVersion() > maximumMajorVersion) {
LOGE() << "MuseSampler " << current.toString() << " is not supported (too new -- update MuseScore); ignoring";
return;
}
Expand Down

0 comments on commit 01137bd

Please sign in to comment.