From 4c76b275907cf2d764f3fc51468d1c58635a10c1 Mon Sep 17 00:00:00 2001 From: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> Date: Mon, 12 May 2025 10:28:05 -0700 Subject: Cleanups related to RIFF support (#7041) --- source/core/slang-semantic-version.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/core/slang-semantic-version.cpp') diff --git a/source/core/slang-semantic-version.cpp b/source/core/slang-semantic-version.cpp index b05eb503f..a7697ad8f 100644 --- a/source/core/slang-semantic-version.cpp +++ b/source/core/slang-semantic-version.cpp @@ -93,6 +93,28 @@ void SemanticVersion::append(StringBuilder& buf) const return bestVersion; } +bool SemanticVersion::isBackwardsCompatibleWith(const ThisType& otherVersion) const +{ + // Compatibility is not guaranteed across major revisions. + // + if (m_major != otherVersion.m_major) + return false; + + // Within a given major revision, a version with a higher + // minor revision is backwards-compatible with one that + // has a lower minor revision, but not vice-versa. + // + if (m_minor < otherVersion.m_minor) + return false; + + // If the major and minor revisions pass our check, then + // we consider it a match. Note that this intentionally + // doesn't check the path version at all. + // + return true; +} + + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MatchSemanticVersion !!!!!!!!!!!!!!!!!!!!!!!!!!!!! /* static */ SemanticVersion MatchSemanticVersion::findAnyBest( -- cgit v1.2.3