summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Initialize.cpp11
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp5
2 files changed, 15 insertions, 1 deletions
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index dc98f7e775f..e0d690ffa2b 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -154,7 +154,18 @@ Ice::initializeWithProperties(int& argc, char* argv[], const PropertiesPtr& prop
//
// Major and minor version numbers must match.
//
+ //
+ // Major and minor version numbers must match.
+ //
if(version != ICE_INT_VERSION)
+ //
+ // The caller's patch level cannot be greater than library's patch level. (Patch level changes are
+ // backward-compatible, but not forward-compatible.)
+ //
+ if(version % 100 > ICE_INT_VERSION % 100)
+ {
+ throw VersionMismatchException(__FILE__, __LINE__);
+ }
{
throw VersionMismatchException(__FILE__, __LINE__);
}
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 6bb4d585c5c..6737ac0c193 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -90,9 +90,12 @@ Slice::printVersionCheck(Output& out)
{
out << "\n";
out << "\n#ifndef ICE_IGNORE_VERSION";
- out << "\n# if ICE_INT_VERSION != " << ICE_INT_VERSION;
+ out << "\n# if ICE_INT_VERSION / 100 != " << ICE_INT_VERSION / 100;
out << "\n# error Ice version mismatch!";
out << "\n# endif";
+ out << "\n# if ICE_INT_VERSION % 100 < " << ICE_INT_VERSION % 100;
+ out << "\n# error Ice patch level mismatch!";
+ out << "\n# endif";
out << "\n#endif";
}