summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2013-07-17 17:57:56 +0200
committerJose <jose@zeroc.com>2013-07-17 17:57:56 +0200
commitda37321a0d8b21df897e5af64b8c03194987f061 (patch)
tree101b7a1cc7300cc8162c4a60a867677d97875ef1 /cpp/src
parentFixed ICE-5375 - Consider to add ICE_TRANSLATOR preprocessor macro (diff)
downloadice-da37321a0d8b21df897e5af64b8c03194987f061.tar.bz2
ice-da37321a0d8b21df897e5af64b8c03194987f061.tar.xz
ice-da37321a0d8b21df897e5af64b8c03194987f061.zip
Simplification for Slice predefined macros
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/FreezeScript/DumpDB.cpp2
-rw-r--r--cpp/src/FreezeScript/transformdb.cpp4
-rw-r--r--cpp/src/Slice/Preprocessor.cpp19
-rw-r--r--cpp/src/slice2cpp/Main.cpp6
-rw-r--r--cpp/src/slice2cs/Main.cpp6
-rw-r--r--cpp/src/slice2java/Main.cpp6
-rw-r--r--cpp/src/slice2php/Main.cpp6
-rw-r--r--cpp/src/slice2py/Main.cpp6
-rw-r--r--cpp/src/slice2rb/Main.cpp6
9 files changed, 25 insertions, 36 deletions
diff --git a/cpp/src/FreezeScript/DumpDB.cpp b/cpp/src/FreezeScript/DumpDB.cpp
index ca011caedb0..6c76878ce0c 100644
--- a/cpp/src/FreezeScript/DumpDB.cpp
+++ b/cpp/src/FreezeScript/DumpDB.cpp
@@ -343,7 +343,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
Slice::UnitPtr unit = Slice::Unit::createUnit(true, true, ice, underscore);
FreezeScript::Destroyer<Slice::UnitPtr> unitD(unit);
- if(!FreezeScript::parseSlice(appName, unit, slice, cppArgs, debug, "-DICE_COMPILER=ICE_DUMPDB"))
+ if(!FreezeScript::parseSlice(appName, unit, slice, cppArgs, debug, "-D___DUMPDB__"))
{
return EXIT_FAILURE;
}
diff --git a/cpp/src/FreezeScript/transformdb.cpp b/cpp/src/FreezeScript/transformdb.cpp
index c4c3f1fe002..443e918b452 100644
--- a/cpp/src/FreezeScript/transformdb.cpp
+++ b/cpp/src/FreezeScript/transformdb.cpp
@@ -437,7 +437,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
Slice::UnitPtr oldUnit = Slice::Unit::createUnit(true, true, ice, underscore);
FreezeScript::Destroyer<Slice::UnitPtr> oldD(oldUnit);
if(!FreezeScript::parseSlice(appName, oldUnit, oldSlice, oldCppArgs, debug,
- "-DICE_COMPILER=ICE_TRANSFORMDB"))
+ "-D__TRANSFORMDB__"))
{
return EXIT_FAILURE;
}
@@ -445,7 +445,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
Slice::UnitPtr newUnit = Slice::Unit::createUnit(true, true, ice, underscore);
FreezeScript::Destroyer<Slice::UnitPtr> newD(newUnit);
if(!FreezeScript::parseSlice(appName, newUnit, newSlice, newCppArgs, debug,
- "-DICE_COMPILER=ICE_TRANSFORMDB"))
+ "-D__TRANSFORMDB__"))
{
return EXIT_FAILURE;
}
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 352cdf4147a..348f88ca841 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -151,19 +151,6 @@ baseArgs(vector<string> args, bool keepComments, const string& extraArgs, const
ostringstream version;
version << "-DICE_VERSION=" << ICE_INT_VERSION;
args.push_back(version.str());
-
- args.push_back("-DICE_SLICE2CPP=1");
- args.push_back("-DICE_SLICE2CS=2");
- args.push_back("-DICE_SLICE2FREEZE=3");
- args.push_back("-DICE_SLICE2FREEZEJ=4");
- args.push_back("-DICE_SLICE2HTML=5");
- args.push_back("-DICE_SLICE2JAVA=6");
- args.push_back("-DICE_SLICE2PHP=7");
- args.push_back("-DICE_SLICE2PY=8");
- args.push_back("-DICE_SLICE2RB=9");
- args.push_back("-DICE_TRANSFORMDB=10");
- args.push_back("-DICE_DUMPDB=11");
-
if(!extraArgs.empty())
{
args.push_back(extraArgs);
@@ -301,8 +288,10 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
//
// Build arguments list.
//
- vector<string> args = baseArgs(_args, false, extraArgs, _fileName);
-
+ vector<string> args = _args;
+ args.push_back("-M");
+ args = baseArgs(args, false, extraArgs, _fileName);
+
const char** argv = new const char*[args.size() + 1];
for(unsigned int i = 0; i < args.size(); ++i)
{
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index eb31d0414db..4256fd71d6d 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -204,7 +204,7 @@ compile(int argc, char* argv[])
if(depend)
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2CPP");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2CPP__");
if(cppHandle == 0)
{
@@ -221,7 +221,7 @@ compile(int argc, char* argv[])
}
if(!icecpp->printMakefileDependencies(Preprocessor::CPlusPlus, includePaths,
- "-DICE_COMPILER=ICE_SLICE2CPP", sourceExtension, headerExtension))
+ "-D__SLICE2CPP__", sourceExtension, headerExtension))
{
return EXIT_FAILURE;
}
@@ -234,7 +234,7 @@ compile(int argc, char* argv[])
else
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2CPP");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2CPP__");
if(cppHandle == 0)
{
diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp
index 0f91002bbf3..63538af0159 100644
--- a/cpp/src/slice2cs/Main.cpp
+++ b/cpp/src/slice2cs/Main.cpp
@@ -198,7 +198,7 @@ compile(int argc, char* argv[])
if(depend)
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2CS");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2CS__");
if(cppHandle == 0)
{
@@ -215,7 +215,7 @@ compile(int argc, char* argv[])
}
if(!icecpp->printMakefileDependencies(Preprocessor::CSharp, includePaths,
- "-DICE_COMPILER=ICE_SLICE2CS"))
+ "-D__SLICE2CS__"))
{
return EXIT_FAILURE;
}
@@ -228,7 +228,7 @@ compile(int argc, char* argv[])
else
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(true, "-DICE_COMPILER=ICE_SLICE2CS");
+ FILE* cppHandle = icecpp->preprocess(true, "-D__SLICE2CS__");
if(cppHandle == 0)
{
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp
index d06b1477a66..6e6da317edb 100644
--- a/cpp/src/slice2java/Main.cpp
+++ b/cpp/src/slice2java/Main.cpp
@@ -219,7 +219,7 @@ compile(int argc, char* argv[])
if(depend || dependxml)
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2JAVA");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2JAVA__");
if(cppHandle == 0)
{
@@ -236,7 +236,7 @@ compile(int argc, char* argv[])
}
if(!icecpp->printMakefileDependencies(depend ? Preprocessor::Java : Preprocessor::JavaXML, includePaths,
- "-DICE_COMPILER=ICE_SLICE2JAVA"
+ "-D__SLICE2JAVA__"
))
{
return EXIT_FAILURE;
@@ -258,7 +258,7 @@ compile(int argc, char* argv[])
FileTracker::instance()->setSource(*i);
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(true, "-DICE_COMPILER=ICE_SLICE2JAVA");
+ FILE* cppHandle = icecpp->preprocess(true, "-D__SLICE2JAVA__");
if(cppHandle == 0)
{
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index 1be68d99238..40315f4319b 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -1670,7 +1670,7 @@ compile(int argc, char* argv[])
if(depend)
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2PHP");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2PHP__");
if(cppHandle == 0)
{
@@ -1686,7 +1686,7 @@ compile(int argc, char* argv[])
return EXIT_FAILURE;
}
- if(!icecpp->printMakefileDependencies(Preprocessor::PHP, includePaths, "-DICE_COMPILER=ICE_SLICE2PHP"))
+ if(!icecpp->printMakefileDependencies(Preprocessor::PHP, includePaths, "-D__SLICE2PHP__"))
{
return EXIT_FAILURE;
}
@@ -1699,7 +1699,7 @@ compile(int argc, char* argv[])
else
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2PHP");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2PHP__");
if(cppHandle == 0)
{
diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp
index 317f0d7c68f..0bb4efe29b6 100644
--- a/cpp/src/slice2py/Main.cpp
+++ b/cpp/src/slice2py/Main.cpp
@@ -490,7 +490,7 @@ compile(int argc, char* argv[])
if(depend)
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2PY");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2PY__");
if(cppHandle == 0)
{
@@ -507,7 +507,7 @@ compile(int argc, char* argv[])
}
if(!icecpp->printMakefileDependencies(Preprocessor::Python, includePaths,
- "-DICE_COMPILER=ICE_SLICE2PY", "", prefix))
+ "-D__SLICE2PY__", "", prefix))
{
return EXIT_FAILURE;
}
@@ -520,7 +520,7 @@ compile(int argc, char* argv[])
else
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(keepComments, "-DICE_COMPILER=ICE_SLICE2PY");
+ FILE* cppHandle = icecpp->preprocess(keepComments, "-D__SLICE2PY__");
if(cppHandle == 0)
{
diff --git a/cpp/src/slice2rb/Main.cpp b/cpp/src/slice2rb/Main.cpp
index a8d2764a2f5..e90329b904c 100644
--- a/cpp/src/slice2rb/Main.cpp
+++ b/cpp/src/slice2rb/Main.cpp
@@ -194,7 +194,7 @@ compile(int argc, char* argv[])
if(depend)
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2RB");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2RB__");
if(cppHandle == 0)
{
@@ -211,7 +211,7 @@ compile(int argc, char* argv[])
}
if(!icecpp->printMakefileDependencies(Preprocessor::Ruby, includePaths,
- "-DICE_COMPILER=ICE_SLICE2RB"))
+ "-D__SLICE2RB__"))
{
return EXIT_FAILURE;
}
@@ -224,7 +224,7 @@ compile(int argc, char* argv[])
else
{
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
- FILE* cppHandle = icecpp->preprocess(false, "-DICE_COMPILER=ICE_SLICE2RB");
+ FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2RB__");
if(cppHandle == 0)
{