Fix parametrized defines with empty arguments.

This commit is contained in:
Wilson Snyder
2010-02-21 07:20:39 -05:00
parent 72218fb475
commit e39eddf3fe
3 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -511,7 +511,9 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) {
if (*cp=='"') quote=!quote;
if (*cp) token += *cp;
}
if (refp->args().size() > numArgs) {
if (refp->args().size() > numArgs
// `define X() is ok to call with nothing
&& !(refp->args().size()==1 && numArgs==0 && trimWhitespace(refp->args()[0],false)=="")) {
fileline()->v3error("Define passed too many arguments: "+refp->name()+"\n");
return " `"+refp->name()+" ";
}