}
/* Check for end of macro param list */
- if (CurC == ')') {
+ if (CurC == ')') {
NextChar ();
break;
}
/* Remember the current input and switch to the macro replacement. */
+ int OldIndex = SB_GetIndex (&E->M->Replacement);
SB_Reset (&E->M->Replacement);
OldSource = InitLine (&E->M->Replacement);
/* Switch back the input */
InitLine (OldSource);
+ SB_SetIndex (&E->M->Replacement, OldIndex);
}
static void ExpandMacro (StrBuf* Target, Macro* M)
/* Expand a macro into Target */
{
- /* ### printf ("Expanding %s(%u)\n", M->Name, ++V); */
+#if 0
+ static unsigned V = 0;
+ printf ("Expanding %s(%u)\n", M->Name, ++V);
+#endif
/* Check if this is a function like macro */
if (M->ArgCount >= 0) {
DoneMacroExp (&E);
}
- /* ### printf ("Done with %s(%u)\n", M->Name, V--); */
+#if 0
+ printf ("Done with %s(%u)\n", M->Name, V--);
+#endif
}
while (IsSpace (SB_LookAtLast (&M->Replacement))) {
SB_Drop (&M->Replacement, 1);
}
-
- /* ### printf ("%s: <%.*s>\n", M->Name, SB_GetLen (&M->Replacement), SB_GetConstBuf (&M->Replacement)); */
+#if 0
+ printf ("%s: <%.*s>\n", M->Name, SB_GetLen (&M->Replacement), SB_GetConstBuf (&M->Replacement));
+#endif
/* If we have an existing macro, check if the redefinition is identical.
* Print a diagnostic if not.