summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Preprocessor.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2013-07-17 23:52:30 +0200
committerJose <jose@zeroc.com>2013-07-17 23:52:30 +0200
commit98bf9c360184ee4d7420419097e8b0c24cd7b29d (patch)
tree3ef51083855fb8d4c185ed1a28fe939adbb984b3 /cpp/src/Slice/Preprocessor.cpp
parentICE-5375 - minor edits (diff)
downloadice-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.cpp16
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);