diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-01-31 18:49:34 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-01-31 18:49:34 +0000 |
commit | 0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3 (patch) | |
tree | a04395675afff4f27841ab86f668117d7a9f7904 /cpp/src | |
parent | Fixed bug 1720 (diff) | |
download | ice-0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3.tar.bz2 ice-0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3.tar.xz ice-0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3.zip |
Beta versioning
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/DynamicLibrary.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/Initialize.cpp | 22 | ||||
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 32 | ||||
-rwxr-xr-x | cpp/src/ca/iceca | 2 |
4 files changed, 60 insertions, 8 deletions
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index 9ac4422a950..d1b25c1a46c 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -70,7 +70,17 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc int minorVersion = (ICE_INT_VERSION / 100) - majorVersion * 100; ostringstream os; os << majorVersion * 10 + minorVersion; - version = os.str(); + + int patchVersion = ICE_INT_VERSION % 100; + if(patchVersion > 50) + { + os << 'b'; + if(patchVersion >= 52) + { + os << (patchVersion - 50); + } + } + version = os.str(); } } else diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index ec31d9b7226..cb7252ddf94 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -108,6 +108,17 @@ Ice::createProperties(int& argc, char* argv[], const PropertiesPtr& defaults, co inline void checkIceVersion(Int version) { #ifndef ICE_IGNORE_VERSION + +# if ICE_INT_VERSION % 100 > 50 + // + // Beta version: exact match required + // + if(ICE_INT_VERSION != version) + { + throw VersionMismatchException(__FILE__, __LINE__); + } +# else + // // Major and minor version numbers must match. // @@ -115,6 +126,15 @@ inline void checkIceVersion(Int version) { throw VersionMismatchException(__FILE__, __LINE__); } + + // + // Reject beta caller + // + if(version % 100 > 50) + { + 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.) @@ -123,6 +143,8 @@ inline void checkIceVersion(Int version) { throw VersionMismatchException(__FILE__, __LINE__); } + +# endif #endif } diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index bef622075e1..b4f9d48f8d0 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -99,12 +99,32 @@ Slice::printVersionCheck(Output& out) { out << "\n"; out << "\n#ifndef ICE_IGNORE_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"; + if(ICE_INT_VERSION % 100 > 50) + { + // + // Beta version: exact match required + // + out << "\n# if ICE_INT_VERSION != " << ICE_INT_VERSION; + out << "\n# error Ice version mismatch: an exact match is required for beta generated code"; + out << "\n# endif"; + } + else + { + out << "\n# if ICE_INT_VERSION / 100 != " << ICE_INT_VERSION / 100; + out << "\n# error Ice version mismatch!"; + out << "\n# endif"; + + // + // Generated code is release; reject beta header + // + out << "\n# if ICE_INT_VERSION % 100 > 50"; + out << "\n# error Beta header file detected"; + 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"; } diff --git a/cpp/src/ca/iceca b/cpp/src/ca/iceca index 1d11213724d..56245e1753b 100755 --- a/cpp/src/ca/iceca +++ b/cpp/src/ca/iceca @@ -71,7 +71,7 @@ if sys.argv[script] == "import": # handles standard tarball installs. # for bindir in [os.path.dirname(sys.argv[0]), os.path.join(os.getenv("ICE_HOME"), "bin"), ".", "/usr/bin", \ - "/opt/Ice-3.2.0/bin"]: + "/opt/Ice-3.2b/bin"]: bindir = os.path.normpath(bindir) if os.path.exists(os.path.join(bindir, "ImportKey.class")): break |