+/* A helper function that rewrites the definition of a special macro,
+ when needed. */
+
+static struct macro_definition *
+fixup_definition (const char *filename, int line, struct macro_definition *def)
+{
+ static char *saved_expansion;
+
+ if (saved_expansion)
+ {
+ xfree (saved_expansion);
+ saved_expansion = NULL;
+ }
+
+ if (def->kind == macro_object_like)
+ {
+ if (def->argc == macro_FILE)
+ {
+ saved_expansion = macro_stringify (filename);
+ def->replacement = saved_expansion;
+ }
+ else if (def->argc == macro_LINE)
+ {
+ saved_expansion = xstrprintf ("%d", line);
+ def->replacement = saved_expansion;
+ }
+ }
+
+ return def;
+}