mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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.
This commit is contained in:
@ -117,14 +117,14 @@ public:
|
|||||||
return number_;
|
return number_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- The major version number
|
//- Return the major version number.
|
||||||
inline int major() const noexcept
|
inline int getMajor() const noexcept
|
||||||
{
|
{
|
||||||
return int(number_ / 10);
|
return int(number_ / 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- The minor version number
|
//- Return the minor version number
|
||||||
inline int minor() const noexcept
|
inline int getMinor() const noexcept
|
||||||
{
|
{
|
||||||
return int(number_ % 10);
|
return int(number_ % 10);
|
||||||
}
|
}
|
||||||
@ -132,7 +132,10 @@ public:
|
|||||||
//- A string representation of major.minor
|
//- A string representation of major.minor
|
||||||
std::string str() const
|
std::string str() const
|
||||||
{
|
{
|
||||||
return std::to_string(major()) + '.' + std::to_string(minor());
|
return
|
||||||
|
std::to_string(getMajor())
|
||||||
|
+ '.'
|
||||||
|
+ std::to_string(getMinor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user