Skip to content

Commit 01137bd

Browse files
committed
Fixed error: In the GNU C Library, "major" is defined by <sys/types.h>
1 parent dbe7c6d commit 01137bd

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/framework/global/types/version.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,17 @@ Version::Version(const mu::String& versionStr)
9797
setSuffix(versionStr.right(versionStr.size() - versionStr.indexOf(SUFFIX_DELIMITER) - 1));
9898
}
9999

100-
int Version::major() const
100+
int Version::majorVersion() const
101101
{
102102
return m_major;
103103
}
104104

105-
int Version::minor() const
105+
int Version::minorVersion() const
106106
{
107107
return m_minor;
108108
}
109109

110-
int Version::patch() const
110+
int Version::patchVersion() const
111111
{
112112
return m_patch;
113113
}
@@ -148,15 +148,15 @@ mu::String Version::toString()
148148

149149
bool Version::operator <(const Version& other) const
150150
{
151-
if (m_major > other.major()) {
151+
if (m_major > other.majorVersion()) {
152152
return false;
153-
} else if (m_major == other.major()) {
154-
if (m_minor > other.minor()) {
153+
} else if (m_major == other.majorVersion()) {
154+
if (m_minor > other.minorVersion()) {
155155
return false;
156-
} else if (m_minor == other.minor()) {
157-
if (m_patch > other.patch()) {
156+
} else if (m_minor == other.minorVersion()) {
157+
if (m_patch > other.patchVersion()) {
158158
return false;
159-
} else if (m_patch == other.patch()) {
159+
} else if (m_patch == other.patchVersion()) {
160160
if (m_suffix.isEmpty()) {
161161
return false;
162162
}
@@ -203,9 +203,9 @@ bool Version::operator <(const Version& other) const
203203

204204
bool Version::operator ==(const Version& other) const
205205
{
206-
return m_major == other.major()
207-
&& m_minor == other.minor()
208-
&& m_patch == other.patch()
206+
return m_major == other.majorVersion()
207+
&& m_minor == other.minorVersion()
208+
&& m_patch == other.patchVersion()
209209
&& m_suffix == other.suffix()
210210
&& m_suffixVersion == other.suffixVersion();
211211
}

src/framework/global/types/version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class Version
3131
Version(int major, int minor = 0, int patch = 0, const String& suffix = String(), int suffixVersion = 0);
3232
Version(const String& versionStr);
3333

34-
int major() const;
35-
int minor() const;
36-
int patch() const;
34+
int majorVersion() const;
35+
int minorVersion() const;
36+
int patchVersion() const;
3737
String suffix() const;
3838
int suffixVersion() const;
3939

src/framework/musesampler/internal/libhandler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ struct MuseSamplerLibHandler
271271
// Major versions have incompatible changes; we can only support
272272
// interfaces we know about.
273273
// TODO: check when we fixed the issue with version numbers not reporting? Was this ever an issue?
274-
if (current.major() > maximumMajorVersion) {
274+
if (current.majorVersion() > maximumMajorVersion) {
275275
LOGE() << "MuseSampler " << current.toString() << " is not supported (too new -- update MuseScore); ignoring";
276276
return;
277277
}

0 commit comments

Comments
 (0)