diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 39 | ||||
-rw-r--r-- | cpp/src/slice2cppe/Gen.cpp | 8 |
2 files changed, 38 insertions, 9 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index adf24fd7267..12e79879706 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -13,6 +13,12 @@ using namespace std; using namespace Slice; using namespace IceUtil; +// +// The Ice-E version. +// +#define ICEE_STRING_VERSION "1.0.0" // "A.B.C", with A=major, B=minor, C=patch +#define ICEE_INT_VERSION 10000 // AABBCC, with AA=major, BB=minor, CC=patch + char Slice::ToIfdef::operator()(char c) { @@ -68,7 +74,7 @@ Slice::changeInclude(const string& orig, const vector<string>& includePaths) } void -Slice::printHeader(Output& out) +Slice::printHeader(Output& out, bool icee) { static const char* header = "// **********************************************************************\n" @@ -82,18 +88,41 @@ Slice::printHeader(Output& out) ; out << header; - out << "\n// Ice version " << ICE_STRING_VERSION; + if(icee) + { + out << "\n// Ice-E version " << ICEE_STRING_VERSION; + } + else + { + out << "\n// Ice version " << ICE_STRING_VERSION; + } } void -Slice::printVersionCheck(Output& out) +Slice::printVersionCheck(Output& out, bool icee) { out << "\n"; out << "\n#ifndef ICE_IGNORE_VERSION"; - out << "\n# if ICE_INT_VERSION / 100 != " << ICE_INT_VERSION / 100; + out << "\n# if ICE_INT_VERSION / 100 != "; + if(icee) + { + out << ICEE_INT_VERSION / 100; + } + else + { + out << 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# if ICE_INT_VERSION % 100 < "; + if(icee) + { + out << ICEE_INT_VERSION % 100; + } + else + { + out << ICE_INT_VERSION % 100; + } out << "\n# error Ice patch level mismatch!"; out << "\n# endif"; out << "\n#endif"; diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index acff9cd2713..51933ca3de6 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -140,8 +140,8 @@ Slice::Gen::Gen(const string& name, const string& base, const string& headerExte return; } - printHeader(H); - printHeader(C); + printHeader(H, true); + printHeader(C, true); H << "\n// Generated from file `" << changeInclude(_base, _includePaths) << ".ice'\n"; C << "\n// Generated from file `" << changeInclude(_base, _includePaths) << ".ice'\n"; @@ -243,8 +243,8 @@ Slice::Gen::generate(const UnitPtr& p) H << "\n#include <Ice/UndefSysMacros.h>"; - printVersionCheck(H); - printVersionCheck(C); + printVersionCheck(H, true); + printVersionCheck(C, true); printDllExportStuff(H, _dllExport); if(_dllExport.size()) |