summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/Calc.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-11-10 05:30:26 +0100
committerJose <jose@zeroc.com>2009-11-10 05:30:26 +0100
commit4247c9e2c2612394a5f4d63a65ba538f975906d4 (patch)
tree96d3308681d9b0684ce5dd763f5a5d415eaf09d7 /cpp/src/IcePatch2/Calc.cpp
parentWin32 64 bits compilation error (diff)
downloadice-4247c9e2c2612394a5f4d63a65ba538f975906d4.tar.bz2
ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.tar.xz
ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.zip
Fixed 3962 - Berkeley DB, problems with unicode paths.
Diffstat (limited to 'cpp/src/IcePatch2/Calc.cpp')
-rw-r--r--cpp/src/IcePatch2/Calc.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/cpp/src/IcePatch2/Calc.cpp b/cpp/src/IcePatch2/Calc.cpp
index 2755afdec0f..401f318d010 100644
--- a/cpp/src/IcePatch2/Calc.cpp
+++ b/cpp/src/IcePatch2/Calc.cpp
@@ -96,7 +96,7 @@ public:
};
void
-usage(const char* appName)
+usage(const string& appName)
{
cerr << "Usage: " << appName << " [options] DIR [FILES...]\n";
cerr <<
@@ -110,9 +110,22 @@ usage(const char* appName)
;
}
+//COMPILERFIX: Borland C++ 2010 doesn't support wmain for console applications.
+#if defined(_WIN32 ) && !defined(__BCPLUSPLUS__)
+
+int
+wmain(int argc, wchar_t* argv[])
+
+#else
+
int
main(int argc, char* argv[])
+
+#endif
{
+ Ice::StringSeq originalArgs = Ice::argsToStringSeq(argc, argv);
+ assert(originalArgs.size() > 0);
+ const string appName = originalArgs[0];
string dataDir;
StringSeq fileSeq;
int compress = 1;
@@ -130,18 +143,18 @@ main(int argc, char* argv[])
vector<string> args;
try
{
- args = opts.parse(argc, (const char**)argv);
+ args = opts.parse(originalArgs);
}
catch(const IceUtilInternal::BadOptException& e)
{
cerr << e.reason << endl;
- usage(argv[0]);
+ usage(appName);
return EXIT_FAILURE;
}
if(opts.isSet("help"))
{
- usage(argv[0]);
+ usage(appName);
return EXIT_SUCCESS;
}
if(opts.isSet("version"))
@@ -153,8 +166,8 @@ main(int argc, char* argv[])
bool dontCompress = opts.isSet("no-compress");
if(doCompress && dontCompress)
{
- cerr << argv[0] << ": only one of -z and -Z are mutually exclusive" << endl;
- usage(argv[0]);
+ cerr << appName << ": only one of -z and -Z are mutually exclusive" << endl;
+ usage(appName);
return EXIT_FAILURE;
}
if(doCompress)
@@ -170,8 +183,8 @@ main(int argc, char* argv[])
if(args.empty())
{
- cerr << argv[0] << ": no data directory specified" << endl;
- usage(argv[0]);
+ cerr << appName << ": no data directory specified" << endl;
+ usage(appName);
return EXIT_FAILURE;
}
dataDir = simplify(args[0]);
@@ -300,12 +313,12 @@ main(int argc, char* argv[])
}
catch(const string& ex)
{
- cerr << argv[0] << ": " << ex << endl;
+ cerr << appName << ": " << ex << endl;
return EXIT_FAILURE;
}
catch(const char* ex)
{
- cerr << argv[0] << ": " << ex << endl;
+ cerr << appName << ": " << ex << endl;
return EXIT_FAILURE;
}