Skip to content
Snippets Groups Projects
Commit 48dafded authored by Mark OLESEN's avatar Mark OLESEN
Browse files

COMP: fix warnings about major()/minor() name conflicts (closes #883)

- major() and minor() are GNU macros in sys/sysmacros.h
  and generates warning on some systems (eg, Ubuntu 18.04)

  use getMajor() and getMinor() as method names instead.
parent dad09c5e
Branches
Tags
No related merge requests found
......@@ -117,14 +117,14 @@ public:
return number_;
}
//- The major version number
inline int major() const noexcept
//- Return the major version number.
inline int getMajor() const noexcept
{
return int(number_ / 10);
}
//- The minor version number
inline int minor() const noexcept
//- Return the minor version number
inline int getMinor() const noexcept
{
return int(number_ % 10);
}
......@@ -132,7 +132,10 @@ public:
//- A string representation of major.minor
std::string str() const
{
return std::to_string(major()) + '.' + std::to_string(minor());
return
std::to_string(getMajor())
+ '.'
+ std::to_string(getMinor());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment