Expand macro arguments before performing argument substitution.

As required by the C99 specification of the preprocessor.

With this fix, tests 33 through 36 now pass.
This commit is contained in:
Carl Worth 2010-05-26 08:09:29 -07:00
parent 0197e9b64f
commit d5cd40343f

View file

@ -854,10 +854,11 @@ _glcpp_parser_expand_function_onto (glcpp_parser_t *parser,
token_list_t *argument; token_list_t *argument;
argument = _argument_list_member_at (arguments, argument = _argument_list_member_at (arguments,
parameter_index); parameter_index);
for (j = argument->head; j; j = j->next) /* Before substituting, we expand the argument
{ * tokens. */
_token_list_append (substituted, j->token); _glcpp_parser_expand_token_list_onto (parser,
} argument,
substituted);
} else { } else {
_token_list_append (substituted, i->token); _token_list_append (substituted, i->token);
} }