fix macro with empy args
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6751 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
82648b1d25
commit
b574e77f6b
3 changed files with 6 additions and 2 deletions
|
|
@ -266,7 +266,7 @@ inline const char* mangle ## #@__VA_ARGS__ () {
|
||||||
#define THREE(FOO) 3
|
#define THREE(FOO) 3
|
||||||
|
|
||||||
#define one ONE
|
#define one ONE
|
||||||
#define two TWO
|
#define two TWO()
|
||||||
#define three THREE(42)
|
#define three THREE(42)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,7 @@ if preproc.define != 1:
|
||||||
|
|
||||||
if preproc.defined != 1:
|
if preproc.defined != 1:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
if 2*preproc.one != preproc.two:
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -618,7 +618,7 @@ expand_macro(String_or_char *name, List *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the macro expects arguments, but none were supplied, we leave it in place */
|
/* If the macro expects arguments, but none were supplied, we leave it in place */
|
||||||
if (!args && (margs)) {
|
if (!args && (margs) && Len(margs) > 0) {
|
||||||
return NewString(name);
|
return NewString(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue