aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/pre-process.c
diff options
Diffstat (limited to 'pre-process.c')
-rw-r--r--pre-process.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/pre-process.c b/pre-process.c
index a258da68..f0a9cf24 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -2167,6 +2167,12 @@ struct token * preprocess(struct token *token)
return token;
}
+static int is_VA_ARGS_token(struct token *token)
+{
+ return (token_type(token) == TOKEN_IDENT) &&
+ (token->ident == &__VA_ARGS___ident);
+}
+
static void dump_macro(struct symbol *sym)
{
int nargs = sym->arglist ? sym->arglist->count.normal : 0;
@@ -2182,7 +2188,10 @@ static void dump_macro(struct symbol *sym)
for (; !eof_token(token); token = token->next) {
if (token_type(token) == TOKEN_ARG_COUNT)
continue;
- printf("%s%s", sep, show_token(token));
+ if (is_VA_ARGS_token(token))
+ printf("%s...", sep);
+ else
+ printf("%s%s", sep, show_token(token));
args[narg++] = token;
sep = ",";
}