Fix erroneous line numbers in argument count error messages for macro expansions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12201 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
45601f24b4
commit
197c8e899d
2 changed files with 13 additions and 3 deletions
|
|
@ -773,11 +773,11 @@ static String *expand_macro(String *name, List *args, String *line_file) {
|
|||
/* If there are arguments, see if they match what we were given */
|
||||
if (args && (margs) && (Len(margs) != Len(args))) {
|
||||
if (Len(margs) > (1 + isvarargs))
|
||||
Swig_error(Getfile(args), Getline(args), "Macro '%s' expects %d arguments\n", name, Len(margs) - isvarargs);
|
||||
Swig_error(macro_start_file, macro_start_line, "Macro '%s' expects %d arguments\n", name, Len(margs) - isvarargs);
|
||||
else if (Len(margs) == (1 + isvarargs))
|
||||
Swig_error(Getfile(args), Getline(args), "Macro '%s' expects 1 argument\n", name);
|
||||
Swig_error(macro_start_file, macro_start_line, "Macro '%s' expects 1 argument\n", name);
|
||||
else
|
||||
Swig_error(Getfile(args), Getline(args), "Macro '%s' expects no arguments\n", name);
|
||||
Swig_error(macro_start_file, macro_start_line, "Macro '%s' expects no arguments\n", name);
|
||||
macro_level--;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue