summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Main.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-07-19 18:03:12 +0000
committerMarc Laukien <marc@zeroc.com>2001-07-19 18:03:12 +0000
commite1605c7fc18ef05c35d8abbc7f538b66205ebade (patch)
tree30217edce6f774d313f8748865c40d70f9f917d1 /cpp/src/slice2cpp/Main.cpp
parentfixes (diff)
downloadice-e1605c7fc18ef05c35d8abbc7f538b66205ebade.tar.bz2
ice-e1605c7fc18ef05c35d8abbc7f538b66205ebade.tar.xz
ice-e1605c7fc18ef05c35d8abbc7f538b66205ebade.zip
error checking
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r--cpp/src/slice2cpp/Main.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 98c21ca0058..5ca04edff48 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -128,6 +128,8 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
+ int status = EXIT_SUCCESS;
+
for(idx = 1 ; idx < argc ; ++idx)
{
string base(argv[idx]);
@@ -169,7 +171,7 @@ main(int argc, char* argv[])
}
Unit_ptr unit = Unit::createUnit(false, false);
- int status = unit -> parse(cppHandle, debug);
+ int parseStatus = unit -> parse(cppHandle, debug);
#ifdef WIN32
_pclose(cppHandle);
@@ -177,16 +179,20 @@ main(int argc, char* argv[])
pclose(cppHandle);
#endif
- if(status == EXIT_FAILURE)
- return status;
-
- Gen gen(argv[0], base, include, includePaths, dllExport);
- if(!gen)
- return EXIT_FAILURE;
- gen.generate(unit);
+ if(parseStatus == EXIT_FAILURE)
+ {
+ status = EXIT_FAILURE;
+ }
+ else
+ {
+ Gen gen(argv[0], base, include, includePaths, dllExport);
+ if(!gen)
+ status = EXIT_FAILURE;
+ gen.generate(unit);
+ }
unit -> destroy();
}
- return EXIT_SUCCESS;
+ return status;
}