From e22b4bd48c85de1c5f62a4ccbf178668b02f191d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 13 Feb 2019 12:09:13 -0800 Subject: driver: Pass -idirafter to preprocessor --- driver.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/driver.c b/driver.c index fee1954..0ff8451 100644 --- a/driver.c +++ b/driver.c @@ -328,12 +328,11 @@ main(int argc, char *argv[]) arrayaddptr(&phases[LINK].cmd, arg); } else if (strcmp(arg, "-emit-qbe") == 0) { last = COMPILE; - } else if (strcmp(arg, "-include") == 0) { - --argc, arg = *++argv; - if (!arg) + } else if (strcmp(arg, "-include") == 0 || strcmp(arg, "-idirafter") == 0) { + if (!--argc) usage(); - arrayaddptr(&phases[PREPROCESS].cmd, "-include"); arrayaddptr(&phases[PREPROCESS].cmd, arg); + arrayaddptr(&phases[PREPROCESS].cmd, *++argv); } else if (strcmp(arg, "-pipe") == 0) { /* ignore */ } else { -- cgit v1.2.3