summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r--cpp/src/slice2cpp/Main.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index c0da52fdaec..013f3dbce16 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -73,7 +73,8 @@ usage(const char* n)
"--include-dir DIR Use DIR as the header include directory in source files.\n"
"--output-dir DIR Create files in the directory DIR.\n"
"--dll-export SYMBOL Use SYMBOL for DLL exports.\n"
- "--impl Generate sample implementations.\n"
+ "--impl-c++98 Generate sample implementations for C++98 mapping.\n"
+ "--impl-c++11 Generate sample implementations for C++11 mapping.\n"
"--depend Generate Makefile dependencies.\n"
"--depend-xml Generate dependencies in XML format.\n"
"--depend-file FILE Write dependencies to FILE instead of standard output.\n"
@@ -102,7 +103,8 @@ compile(int argc, char* argv[])
opts.addOpt("", "include-dir", IceUtilInternal::Options::NeedArg);
opts.addOpt("", "output-dir", IceUtilInternal::Options::NeedArg);
opts.addOpt("", "dll-export", IceUtilInternal::Options::NeedArg);
- opts.addOpt("", "impl");
+ opts.addOpt("", "impl-c++98");
+ opts.addOpt("", "impl-c++11");
opts.addOpt("", "depend");
opts.addOpt("", "depend-xml");
opts.addOpt("", "depend-file", IceUtilInternal::Options::NeedArg, "");
@@ -182,7 +184,9 @@ compile(int argc, char* argv[])
string dllExport = opts.optArg("dll-export");
- bool impl = opts.isSet("impl");
+ bool implCpp98 = opts.isSet("impl-c++98");
+
+ bool implCpp11 = opts.isSet("impl-c++11");
bool depend = opts.isSet("depend");
@@ -219,6 +223,16 @@ compile(int argc, char* argv[])
}
return EXIT_FAILURE;
}
+
+ if(implCpp98 && implCpp11)
+ {
+ getErrorStream() << argv[0] << ": error: cannot specify both --impl-c++98 and --impl-c++11" << endl;
+ if(!validate)
+ {
+ usage(argv[0]);
+ }
+ return EXIT_FAILURE;
+ }
if(validate)
{
@@ -326,7 +340,7 @@ compile(int argc, char* argv[])
try
{
Gen gen(icecpp->getBaseName(), headerExtension, sourceExtension, extraHeaders, include,
- includePaths, dllExport, output, impl, checksum, stream, ice);
+ includePaths, dllExport, output, implCpp98, implCpp11, checksum, stream, ice);
gen.generate(u);
}
catch(const Slice::FileException& ex)