diff options
author | Jose <jose@zeroc.com> | 2013-07-17 23:52:30 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2013-07-17 23:52:30 +0200 |
commit | 98bf9c360184ee4d7420419097e8b0c24cd7b29d (patch) | |
tree | 3ef51083855fb8d4c185ed1a28fe939adbb984b3 /cpp/src/Slice/Preprocessor.cpp | |
parent | ICE-5375 - minor edits (diff) | |
download | ice-98bf9c360184ee4d7420419097e8b0c24cd7b29d.tar.bz2 ice-98bf9c360184ee4d7420419097e8b0c24cd7b29d.tar.xz ice-98bf9c360184ee4d7420419097e8b0c24cd7b29d.zip |
Added __ICE_VERSION__ macro
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r-- | cpp/src/Slice/Preprocessor.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 348f88ca841..1573e0e31c7 100644 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -148,9 +148,19 @@ baseArgs(vector<string> args, bool keepComments, const string& extraArgs, const } args.push_back("-e"); args.push_back("en_us.utf8"); - ostringstream version; - version << "-DICE_VERSION=" << ICE_INT_VERSION; - args.push_back(version.str()); + + // + // Define version macros __ICE_VERSION__ is preferred. We keep + // ICE_VERSION for backward compatibility with 3.5.0. + // + const string version[2] = {"ICE_VERSION", "__ICE_VERSION__"}; + for(int i = 0; i < 2; ++i) + { + ostringstream os; + os << "-D" << version[i] << "=" << ICE_INT_VERSION; + args.push_back(os.str()); + } + if(!extraArgs.empty()) { args.push_back(extraArgs); |