use normalized cpperraswarn and nocpperraswarn option instead

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7928 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-05 23:45:10 +00:00
commit cb852a98fd
2 changed files with 11 additions and 16 deletions

View file

@ -67,7 +67,8 @@ static const char *usage1 = (const char*)"\
-ignoremissing - Ignore missing include files\n\
-importall - Follow all #include statements as imports\n\
-includeall - Follow all #include statements\n\
-erroraswarn <v>- Treat (or not) the CPP #error statement as #warning instead\n\
-cpperraswarn - Treat the CPP #error statement as #warning instead\n\
-nocpperraswarn - Don't treat the CPP #error statement as #warning, i.e., crash as CPP\n\
-l<ifile> - Include SWIG library file <ifile>\n\
-M - List all dependencies \n\
-MD - Is equivalent to `-M -MF <file>', except `-E' is not implied\n\
@ -518,18 +519,12 @@ void SWIG_getoptions(int argc, char *argv[])
} else if (strcmp(argv[i],"-ignoremissing") == 0) {
Preprocessor_ignore_missing(1);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-erroraswarn") == 0) {
String *erroraswarn = 0;
} else if (strcmp(argv[i],"-cpperraswarn") == 0) {
Preprocessor_error_as_warning(1);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-nocpperraswarn") == 0) {
Preprocessor_error_as_warning(0);
Swig_mark_arg(i);
if (argv[i+1]) {
erroraswarn = NewString(argv[i+1]);
Swig_mark_arg(i+1);
}
if (!erroraswarn) {
Swig_arg_error();
} else {
Preprocessor_error_as_warning(atoi(Char(erroraswarn)));
}
} else if (strcmp(argv[i],"-tm_debug") == 0) {
tm_debug = 1;
Swig_mark_arg(i);

View file

@ -1521,12 +1521,12 @@ Preprocessor_parse(String *s)
}
} else if (StringEqual(id,k_warning)) {
if (allow) {
Swig_warning(WARN_PP_CPP_WARNING,Getfile(s),Getline(id),"%s\n", value);
Swig_warning(WARN_PP_CPP_WARNING,Getfile(s),Getline(id),"CPP #warning: %s\n", value);
}
} else if (StringEqual(id,k_error)) {
if (allow) {
if (error_as_warning) {
Swig_warning(WARN_PP_CPP_ERROR,Getfile(s),Getline(id),"%s\n", value);
Swig_warning(WARN_PP_CPP_ERROR,Getfile(s),Getline(id),"CPP #error: %s\n", value);
} else {
Swig_error(Getfile(s),Getline(id),"%s\n",value);
}
@ -1580,8 +1580,8 @@ Preprocessor_parse(String *s)
if (strncmp(c,"nowarn=",7) == 0) {
Swig_warnfilter(c+7,1);
}
else if (strncmp(c,"erroraswarn=",7) == 0) {
error_as_warning = atoi(c+12);
else if (strncmp(c,"cpperraswarn=",7) == 0) {
error_as_warning = atoi(c+13);
}
}
}