diff options
Diffstat (limited to 'cpp/src/slice2freezej/Main.cpp')
-rw-r--r-- | cpp/src/slice2freezej/Main.cpp | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index 2ab8c36f86f..336722f5f0f 100644 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -14,6 +14,7 @@ #include <Slice/Preprocessor.h> #include <Slice/FileTracker.h> #include <Slice/JavaUtil.h> +#include <Slice/Util.h> #ifdef __BCPLUSPLUS__ # include <iterator> @@ -280,7 +281,8 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) } if(containsSequence) { - cerr << _prog << ": warning: use of sequences in dictionary keys has been deprecated" << endl; + getErrorStream() << _prog << ": warning: use of sequences in dictionary keys has been deprecated" + << endl; } if(index.caseSensitive == false) @@ -355,7 +357,8 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) } if(containsSequence) { - cerr << _prog << ": warning: use of sequences in dictionary keys has been deprecated" << endl; + getErrorStream() << _prog << ": warning: use of sequences in dictionary keys has been deprecated" + << endl; } if(index.caseSensitive == false) @@ -1166,11 +1169,14 @@ main(int argc, char* argv[]) vector<string> args; try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif args = opts.parse(argc, (const char**)argv); } catch(const IceUtilInternal::BadOptException& e) { - cerr << argv[0] << ": " << e.reason << endl; + cerr << argv[0] << ": error: " << e.reason << endl; usage(argv[0]); return EXIT_FAILURE; } @@ -1236,21 +1242,21 @@ main(int argc, char* argv[]) if(dict.name.empty()) { - cerr << argv[0] << ": " << *i << ": no name specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no name specified" << endl; usage(argv[0]); return EXIT_FAILURE; } if(dict.key.empty()) { - cerr << argv[0] << ": " << *i << ": no key specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no key specified" << endl; usage(argv[0]); return EXIT_FAILURE; } if(dict.value.empty()) { - cerr << argv[0] << ": " << *i << ": no value specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no value specified" << endl; usage(argv[0]); return EXIT_FAILURE; } @@ -1295,28 +1301,29 @@ main(int argc, char* argv[]) if(index.name.empty()) { - cerr << argv[0] << ": " << *i << ": no name specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no name specified" << endl; usage(argv[0]); return EXIT_FAILURE; } if(index.type.empty()) { - cerr << argv[0] << ": " << *i << ": no type specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no type specified" << endl; usage(argv[0]); return EXIT_FAILURE; } if(index.member.empty()) { - cerr << argv[0] << ": " << *i << ": no member specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no member specified" << endl; usage(argv[0]); return EXIT_FAILURE; } if(caseString != "case-sensitive" && caseString != "case-insensitive") { - cerr << argv[0] << ": " << *i << ": the case can be `case-sensitive' or `case-insensitive'" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": the case can be `case-sensitive' or " + << "`case-insensitive'" << endl; usage(argv[0]); return EXIT_FAILURE; } @@ -1369,14 +1376,15 @@ main(int argc, char* argv[]) if(dictName.empty()) { - cerr << argv[0] << ": " << *i << ": no dictionary specified" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": no dictionary specified" << endl; usage(argv[0]); return EXIT_FAILURE; } if(caseString != "case-sensitive" && caseString != "case-insensitive") { - cerr << argv[0] << ": " << *i << ": the case can be `case-sensitive' or `case-insensitive'" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": the case can be `case-sensitive' or " + << "`case-insensitive'" << endl; usage(argv[0]); return EXIT_FAILURE; } @@ -1389,7 +1397,8 @@ main(int argc, char* argv[]) { if(find(p->indices.begin(), p->indices.end(), index) != p->indices.end()) { - cerr << argv[0] << ": --dict-index " << *i << ": this dict-index is defined twice" << endl; + getErrorStream() << argv[0] << ": error: --dict-index " << *i + << ": this dict-index is defined twice" << endl; return EXIT_FAILURE; } @@ -1400,7 +1409,7 @@ main(int argc, char* argv[]) } if(!found) { - cerr << argv[0] << ": " << *i << ": unknown dictionary" << endl; + getErrorStream() << argv[0] << ": error: " << *i << ": unknown dictionary" << endl; usage(argv[0]); return EXIT_FAILURE; } @@ -1423,7 +1432,7 @@ main(int argc, char* argv[]) if(dicts.empty() && indices.empty()) { - cerr << argv[0] << ": no Freeze types specified" << endl; + getErrorStream() << argv[0] << ": error: no Freeze types specified" << endl; usage(argv[0]); return EXIT_FAILURE; } @@ -1517,7 +1526,7 @@ main(int argc, char* argv[]) // created files. FileTracker::instance()->cleanup(); u->destroy(); - cerr << argv[0] << ": " << ex << endl; + getErrorStream() << argv[0] << ": error: " << ex << endl; return EXIT_FAILURE; } catch(const Slice::FileException& ex) @@ -1526,13 +1535,13 @@ main(int argc, char* argv[]) // created files. FileTracker::instance()->cleanup(); u->destroy(); - cerr << ex.reason() << endl; + getErrorStream() << argv[0] << ": error: " << ex.reason() << endl; return EXIT_FAILURE; } catch(...) { FileTracker::instance()->cleanup(); - cerr << argv[0] << ": unknown exception" << endl; + getErrorStream() << argv[0] << ": error: unknown exception" << endl; u->destroy(); return EXIT_FAILURE; } @@ -1550,7 +1559,7 @@ main(int argc, char* argv[]) // created files. FileTracker::instance()->cleanup(); u->destroy(); - cerr << argv[0] << ": " << ex << endl; + getErrorStream() << argv[0] << ": error: " << ex << endl; return EXIT_FAILURE; } catch(const Slice::FileException& ex) @@ -1559,12 +1568,12 @@ main(int argc, char* argv[]) // created files. FileTracker::instance()->cleanup(); u->destroy(); - cerr << argv[0] << ": " << ex.reason() << endl; + getErrorStream() << argv[0] << ": error: " << ex.reason() << endl; return EXIT_FAILURE; } catch(...) { - cerr << argv[0] << ": unknown exception" << endl; + getErrorStream() << argv[0] << ": error: unknown exception" << endl; FileTracker::instance()->cleanup(); u->destroy(); return EXIT_FAILURE; |