patch to macros with no arguments (again).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4677 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
07e923c024
commit
cd780b84a6
1 changed files with 9 additions and 8 deletions
|
|
@ -593,6 +593,11 @@ expand_macro(String_or_char *name, List *args)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* If the macro expects arguments, but none were supplied, we leave it in place */
|
||||
if (!args && (margs)) {
|
||||
return NewString(name);
|
||||
}
|
||||
|
||||
/* Copy the macro value */
|
||||
ns = Copy(mvalue);
|
||||
copy_location(mvalue,ns);
|
||||
|
|
@ -600,8 +605,6 @@ expand_macro(String_or_char *name, List *args)
|
|||
/* Tag the macro as being expanded. This is to avoid recursion in
|
||||
macro expansion */
|
||||
|
||||
|
||||
|
||||
temp = NewString("");
|
||||
tempa = NewString("");
|
||||
if (args && margs) {
|
||||
|
|
@ -847,15 +850,13 @@ Preprocessor_replace(DOH *s)
|
|||
if (Getattr(m,"args")) {
|
||||
/* Yep. We need to go find the arguments and do a substitution */
|
||||
args = find_args(s);
|
||||
if (!Len(args)) {
|
||||
Delete(args);
|
||||
args = 0;
|
||||
}
|
||||
} else {
|
||||
args = 0;
|
||||
}
|
||||
if (args) {
|
||||
/* List *nargs = evaluate_args(args);
|
||||
Delete(args);
|
||||
args = nargs; */
|
||||
}
|
||||
|
||||
e = expand_macro(id,args);
|
||||
if (e) {
|
||||
Printf(ns,"%s",e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue