diff options
author | Michi Henning <michi@zeroc.com> | 2005-05-11 05:23:07 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-05-11 05:23:07 +0000 |
commit | 1a6020949b83655354cae3e930b40fc123b5bbee (patch) | |
tree | eed59f5840eb1fc78a6661e891d42968c069c318 /cpp/src/Ice/Initialize.cpp | |
parent | fix for bug 303 - thread synchronization error on HP-UX(64) (diff) | |
download | ice-1a6020949b83655354cae3e930b40fc123b5bbee.tar.bz2 ice-1a6020949b83655354cae3e930b40fc123b5bbee.tar.xz ice-1a6020949b83655354cae3e930b40fc123b5bbee.zip |
Fixed version check so major and minor version must match, and the caller's
patch level must not be greater than the library's.
Diffstat (limited to 'cpp/src/Ice/Initialize.cpp')
-rw-r--r-- | cpp/src/Ice/Initialize.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index 64b8fd9ab29..dc98f7e775f 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -151,10 +151,21 @@ CommunicatorPtr Ice::initializeWithProperties(int& argc, char* argv[], const PropertiesPtr& properties, Int version) { #ifndef ICE_IGNORE_VERSION + // + // Major and minor version numbers must match. + // if(version != ICE_INT_VERSION) { throw VersionMismatchException(__FILE__, __LINE__); } + // + // 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__); + } #endif StringSeq args = argsToStringSeq(argc, argv); |