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;
|
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 */
|
/* Copy the macro value */
|
||||||
ns = Copy(mvalue);
|
ns = Copy(mvalue);
|
||||||
copy_location(mvalue,ns);
|
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
|
/* Tag the macro as being expanded. This is to avoid recursion in
|
||||||
macro expansion */
|
macro expansion */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
temp = NewString("");
|
temp = NewString("");
|
||||||
tempa = NewString("");
|
tempa = NewString("");
|
||||||
if (args && margs) {
|
if (args && margs) {
|
||||||
|
|
@ -847,15 +850,13 @@ Preprocessor_replace(DOH *s)
|
||||||
if (Getattr(m,"args")) {
|
if (Getattr(m,"args")) {
|
||||||
/* Yep. We need to go find the arguments and do a substitution */
|
/* Yep. We need to go find the arguments and do a substitution */
|
||||||
args = find_args(s);
|
args = find_args(s);
|
||||||
|
if (!Len(args)) {
|
||||||
|
Delete(args);
|
||||||
|
args = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
args = 0;
|
args = 0;
|
||||||
}
|
}
|
||||||
if (args) {
|
|
||||||
/* List *nargs = evaluate_args(args);
|
|
||||||
Delete(args);
|
|
||||||
args = nargs; */
|
|
||||||
}
|
|
||||||
|
|
||||||
e = expand_macro(id,args);
|
e = expand_macro(id,args);
|
||||||
if (e) {
|
if (e) {
|
||||||
Printf(ns,"%s",e);
|
Printf(ns,"%s",e);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue