diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-08-15 18:25:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-08-15 18:25:32 +0200 |
commit | f0424d682ef24530f901616611fd04f831c8b432 (patch) | |
tree | eb9fe81be32927ddd14d5de171e13ffea721d8fa | |
parent | b0b19063bffe83af805f2b92106b7da47e21a5d4 (diff) |
Reorder inline function definitions to pacify MinGW GCC (DLL linkage)
-rw-r--r-- | libbutl/semantic-version.ixx | 19 | ||||
-rw-r--r-- | libbutl/semantic-version.mxx | 8 |
2 files changed, 13 insertions, 14 deletions
diff --git a/libbutl/semantic-version.ixx b/libbutl/semantic-version.ixx index cd88663..c9f6659 100644 --- a/libbutl/semantic-version.ixx +++ b/libbutl/semantic-version.ixx @@ -16,9 +16,11 @@ namespace butl { } + // Note: the order is important to MinGW GCC (DLL linkage). + // inline semantic_version:: - semantic_version (const std::string& s, bool ab) - : semantic_version (s, ab ? "-+" : nullptr) + semantic_version (const std::string& s, std::size_t p, bool ab) + : semantic_version (s, p, ab ? "-+" : nullptr) { } @@ -29,18 +31,9 @@ namespace butl } inline semantic_version:: - semantic_version (const std::string& s, std::size_t p, bool ab) - : semantic_version (s, p, ab ? "-+" : nullptr) - { - } - - inline int semantic_version:: - compare (const semantic_version& v, bool ib) const + semantic_version (const std::string& s, bool ab) + : semantic_version (s, ab ? "-+" : nullptr) { - return (major != v.major ? (major < v.major ? -1 : 1) : - minor != v.minor ? (minor < v.minor ? -1 : 1) : - patch != v.patch ? (patch < v.patch ? -1 : 1) : - ib ? 0 : build.compare (v.build)); } struct semantic_version_result diff --git a/libbutl/semantic-version.mxx b/libbutl/semantic-version.mxx index d64eb82..b095f01 100644 --- a/libbutl/semantic-version.mxx +++ b/libbutl/semantic-version.mxx @@ -122,7 +122,13 @@ LIBBUTL_MODEXPORT namespace butl // lexicographically. // int - compare (const semantic_version&, bool ignore_build = false) const; + compare (const semantic_version& v, bool ignore_build = false) const + { + return (major != v.major ? (major < v.major ? -1 : 1) : + minor != v.minor ? (minor < v.minor ? -1 : 1) : + patch != v.patch ? (patch < v.patch ? -1 : 1) : + ignore_build ? 0 : build.compare (v.build)); + } }; // Try to parse a string as a semantic version returning nullopt if invalid. |