aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index c5c20ac..d44bdcb 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -487,6 +487,12 @@ collect_expansion (pfile, arglist)
else if (last_token == PASTE)
cpp_error (pfile, "`##' at end of macro definition");
+ /* Trim trailing white space from definition. */
+ here = CPP_WRITTEN (pfile);
+ while (here > last && is_hspace (pfile->token_buffer [here-1]))
+ here--;
+ CPP_SET_WRITTEN (pfile, here);
+
CPP_NUL_TERMINATE (pfile);
len = CPP_WRITTEN (pfile) - start + 1;
exp = xmalloc (len + 4); /* space for no-concat markers at either end */