Use EXIT_SUCCESS' and EXIT_FAILURE'.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@761 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Thien-Thi Nguyen 2000-08-31 18:04:30 +00:00
commit 877aa52016
11 changed files with 490 additions and 490 deletions

View file

@ -79,7 +79,7 @@ GUILE::parse_args (int argc, char *argv[])
if (argv[i]) { if (argv[i]) {
if (strcmp (argv[i], "-help") == 0) { if (strcmp (argv[i], "-help") == 0) {
fputs (guile_usage, stderr); fputs (guile_usage, stderr);
SWIG_exit (0); SWIG_exit (EXIT_SUCCESS);
} }
// Silent recognition (no side effects) of "-with-smobs" is here // Silent recognition (no side effects) of "-with-smobs" is here
// as a convenience to users. This will be removed after 1.3a4 // as a convenience to users. This will be removed after 1.3a4

View file

@ -428,7 +428,7 @@ void JAVA::headers(void)
// if (file::include("java.swg",f_header) == -1) { // if (file::include("java.swg",f_header) == -1) {
if (Swig_insert_file("java.swg",f_header) == -1) { if (Swig_insert_file("java.swg",f_header) == -1) {
Printf(stderr,"Fatal Error. Unable to locate 'java.swg'.\n"); Printf(stderr,"Fatal Error. Unable to locate 'java.swg'.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
} }

View file

@ -59,7 +59,7 @@ MZSCHEME::parse_args (int argc, char *argv[])
if (argv[i]) { if (argv[i]) {
if (strcmp (argv[i], "-help") == 0) { if (strcmp (argv[i], "-help") == 0) {
fputs (mzscheme_usage, stderr); fputs (mzscheme_usage, stderr);
SWIG_exit (0); SWIG_exit (EXIT_SUCCESS);
} }
else if (strcmp (argv[i], "-prefix") == 0) { else if (strcmp (argv[i], "-prefix") == 0) {
if (argv[i + 1]) { if (argv[i + 1]) {
@ -185,7 +185,7 @@ MZSCHEME::headers (void)
if (Swig_insert_file ("mzscheme.swg", f_header) == -1) { if (Swig_insert_file ("mzscheme.swg", f_header) == -1) {
Printf (stderr, "SWIG : Fatal error. "); Printf (stderr, "SWIG : Fatal error. ");
Printf (stderr, "Unable to locate 'mzscheme.swg' in SWIG library.\n"); Printf (stderr, "Unable to locate 'mzscheme.swg' in SWIG library.\n");
SWIG_exit (1); SWIG_exit (EXIT_FAILURE);
} }
} }
} }

View file

@ -168,12 +168,12 @@ PERL5::parse() {
if (Swig_insert_file("common.swg", f_runtime) == -1) { if (Swig_insert_file("common.swg", f_runtime) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate 'common.swg' in SWIG library.\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate 'common.swg' in SWIG library.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
if (Swig_insert_file("perl5.swg", f_runtime) == -1) { if (Swig_insert_file("perl5.swg", f_runtime) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate 'perl5.swg' in SWIG library.\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate 'perl5.swg' in SWIG library.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
yyparse(); yyparse();
} }
@ -215,7 +215,7 @@ PERL5::initialize()
if (!module){ if (!module){
Printf(stderr,"*** Error. No module name specified.\n"); Printf(stderr,"*** Error. No module name specified.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
if (!package) { if (!package) {
@ -247,7 +247,7 @@ PERL5::initialize()
sprintf(filen,"%s%s.pm", output_dir,m); sprintf(filen,"%s%s.pm", output_dir,m);
if ((f_pm = fopen(filen,"w")) == 0) { if ((f_pm = fopen(filen,"w")) == 0) {
Printf(stderr,"Unable to open %s\n", filen); Printf(stderr,"Unable to open %s\n", filen);
SWIG_exit(0); SWIG_exit (EXIT_FAILURE);
} }
} }
if (!blessed) { if (!blessed) {

View file

@ -140,11 +140,11 @@ PYTHON::parse() {
if (Swig_insert_file("common.swg", f_runtime) == -1) { if (Swig_insert_file("common.swg", f_runtime) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate common.swg. (Possible installation problem).\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate common.swg. (Possible installation problem).\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
if (Swig_insert_file("python.swg", f_runtime) == -1) { if (Swig_insert_file("python.swg", f_runtime) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate python.swg. (Possible installation problem).\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate python.swg. (Possible installation problem).\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
yyparse(); yyparse();
} }
@ -200,7 +200,7 @@ PYTHON::initialize(void) {
if (!module) { if (!module) {
Printf(stderr,"*** Error. No module name specified.\n"); Printf(stderr,"*** Error. No module name specified.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
/* If shadow classing is enabled, we're going to change the module name to "modulec" */ /* If shadow classing is enabled, we're going to change the module name to "modulec" */
if (shadow) { if (shadow) {
@ -211,7 +211,7 @@ PYTHON::initialize(void) {
Append(module,"c"); Append(module,"c");
if ((f_shadow = fopen(filen,"w")) == 0) { if ((f_shadow = fopen(filen,"w")) == 0) {
Printf(stderr,"Unable to open %s\n", filen); Printf(stderr,"Unable to open %s\n", filen);
SWIG_exit(0); SWIG_exit (EXIT_FAILURE);
} }
Printf(f_shadow,"# This file was created automatically by SWIG.\n"); Printf(f_shadow,"# This file was created automatically by SWIG.\n");
Printf(f_shadow,"import %s\n", interface ? interface : module); Printf(f_shadow,"import %s\n", interface ? interface : module);

View file

@ -175,7 +175,7 @@ static void insert_file(char *filename, File *file) {
"SWIG : Fatal error. " "SWIG : Fatal error. "
"Unable to locate %s. (Possible installation problem).\n", "Unable to locate %s. (Possible installation problem).\n",
filename); filename);
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
} }

View file

@ -117,11 +117,11 @@ TCL8::parse() {
} }
/* if (Swig_insert_file("common.swg",f_runtime) == -1) { /* if (Swig_insert_file("common.swg",f_runtime) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate 'common.swg' in SWIG library.\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate 'common.swg' in SWIG library.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
if (Swig_insert_file("swigtcl8.swg",f_runtime) == -1) { if (Swig_insert_file("swigtcl8.swg",f_runtime) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate 'swigtcl8.swg' in SWIG library.\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate 'swigtcl8.swg' in SWIG library.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
*/ */
yyparse(); yyparse();
@ -165,11 +165,11 @@ TCL8::initialize() {
if ((!ns_name) && (nspace)) { if ((!ns_name) && (nspace)) {
Printf(stderr,"Tcl error. Must specify a namespace.\n"); Printf(stderr,"Tcl error. Must specify a namespace.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
if (!init_name) { if (!init_name) {
Printf(stderr,"*** Error. No module name specified.\n"); Printf(stderr,"*** Error. No module name specified.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
Printf(f_header,"#define SWIG_init %s\n", init_name); Printf(f_header,"#define SWIG_init %s\n", init_name);
if (!module) module = NewString("swig"); if (!module) module = NewString("swig");
@ -927,7 +927,7 @@ TCL8::cpp_open_class(char *classname, char *rename, char *ctype, int strip) {
if (!included_object) { if (!included_object) {
if (Swig_insert_file("object.swg",f_header) == -1) { if (Swig_insert_file("object.swg",f_header) == -1) {
Printf(stderr,"SWIG : Fatal error. Unable to locate 'object.swg' in SWIG library.\n"); Printf(stderr,"SWIG : Fatal error. Unable to locate 'object.swg' in SWIG library.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
included_object = 1; included_object = 1;
} }

View file

@ -237,7 +237,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
Swig_mark_arg(i); Swig_mark_arg(i);
} else if (strcmp(argv[i],"-swiglib") == 0) { } else if (strcmp(argv[i],"-swiglib") == 0) {
printf("%s\n", LibDir); printf("%s\n", LibDir);
SWIG_exit(0); SWIG_exit (EXIT_SUCCESS);
} else if (strcmp(argv[i],"-o") == 0) { } else if (strcmp(argv[i],"-o") == 0) {
Swig_mark_arg(i); Swig_mark_arg(i);
if (argv[i+1]) { if (argv[i+1]) {
@ -253,7 +253,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
fprintf(stderr,"Copyright (c) 1995-98\n"); fprintf(stderr,"Copyright (c) 1995-98\n");
fprintf(stderr,"University of Utah and the Regents of the University of California\n"); fprintf(stderr,"University of Utah and the Regents of the University of California\n");
fprintf(stderr,"\nCompiled with %s\n", SWIG_CC); fprintf(stderr,"\nCompiled with %s\n", SWIG_CC);
SWIG_exit(0); SWIG_exit (EXIT_SUCCESS);
} else if (strncmp(argv[i],"-l",2) == 0) { } else if (strncmp(argv[i],"-l",2) == 0) {
// Add a new directory search path // Add a new directory search path
Append(libfiles,argv[i]+2); Append(libfiles,argv[i]+2);
@ -287,7 +287,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
// Parse language dependent options // Parse language dependent options
lang->parse_args(argc,argv); lang->parse_args(argc,argv);
if (help) SWIG_exit(0); // Exit if we're in help mode if (help) SWIG_exit (EXIT_SUCCESS); // Exit if we're in help mode
// Check all of the options to make sure we're cool. // Check all of the options to make sure we're cool.
Swig_check_options(); Swig_check_options();
@ -399,7 +399,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
String *ds = Swig_include(input_file); String *ds = Swig_include(input_file);
if (!ds) { if (!ds) {
Printf(stderr,"Unable to find '%s'\n", input_file); Printf(stderr,"Unable to find '%s'\n", input_file);
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
if (lang_config) { if (lang_config) {
Printf(fs,"\n%%include \"%s\"\n", lang_config); Printf(fs,"\n%%include \"%s\"\n", lang_config);
@ -416,7 +416,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
if (cpp_only) { if (cpp_only) {
Printf(stdout,"%s", cpps); Printf(stdout,"%s", cpps);
while (freeze); while (freeze);
SWIG_exit(0); SWIG_exit (EXIT_SUCCESS);
} }
// Initialize the scanner // Initialize the scanner

View file

@ -895,7 +895,7 @@ statement : INCLUDE STRING LBRACE {
} else { } else {
if (Swig_insert_file($5,f) < 0) { if (Swig_insert_file($5,f) < 0) {
Printf(stderr,"%s:%d: Couldn't find '%s'. Possible installation problem.\n", input_file, line_number, $5); Printf(stderr,"%s:%d: Couldn't find '%s'. Possible installation problem.\n", input_file, line_number, $5);
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
} }
} }

View file

@ -139,7 +139,7 @@ char nextchar() {
if (!LEX_in) return 0; if (!LEX_in) return 0;
if (yylen >= YYBSIZE) { if (yylen >= YYBSIZE) {
Printf(stderr,"** FATAL ERROR. Buffer overflow in scanner.cxx.\nReport this to swig-dev@cs.uchicago.edu.\n"); Printf(stderr,"** FATAL ERROR. Buffer overflow in scanner.cxx.\nReport this to swig-dev@cs.uchicago.edu.\n");
SWIG_exit(1); SWIG_exit (EXIT_FAILURE);
} }
yytext[yylen] = c; yytext[yylen] = c;
yylen++; yylen++;

View file

@ -59,7 +59,7 @@ extern char output_dir[512]; // Output directory
extern int Verbose; extern int Verbose;
extern int IsVirtual; extern int IsVirtual;
#define FatalError() if ((error_count++) > 20) { fprintf(stderr,"Confused by earlier errors. Bailing out\n"); SWIG_exit(1); } #define FatalError() if ((error_count++) > 20) { fprintf(stderr,"Confused by earlier errors. Bailing out\n"); SWIG_exit (EXIT_FAILURE); }
/* Miscellaneous stuff */ /* Miscellaneous stuff */