aboutsummaryrefslogtreecommitdiff
path: root/butl/standard-version
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-28 00:30:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-28 12:08:14 +0300
commitae4dea0483145ec6e57a818907d3f007875a6009 (patch)
tree84c01e0b36292f55dd988a6c55949475f9e42218 /butl/standard-version
parent55f115d875bf70305ca43e93761395b4329a23a6 (diff)
MinGW GCC happy (reorder inline functions, parentheses)
Diffstat (limited to 'butl/standard-version')
-rw-r--r--butl/standard-version17
1 files changed, 16 insertions, 1 deletions
diff --git a/butl/standard-version b/butl/standard-version
index 59056ac..71bd5be 100644
--- a/butl/standard-version
+++ b/butl/standard-version
@@ -69,7 +69,22 @@ namespace butl
earliest () const noexcept;
int
- compare (const standard_version&) const noexcept;
+ compare (const standard_version& v) const noexcept
+ {
+ if (epoch != v.epoch)
+ return epoch < v.epoch ? -1 : 1;
+
+ if (version != v.version)
+ return version < v.version ? -1 : 1;
+
+ if (snapshot_sn != v.snapshot_sn)
+ return snapshot_sn < v.snapshot_sn ? -1 : 1;
+
+ if (revision != v.revision)
+ return revision < v.revision ? -1 : 1;
+
+ return 0;
+ }
// Parse the version. Throw std::invalid_argument if the format is not
// recognizable or components are invalid.