diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-06-27 14:04:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-27 14:04:39 +0200 |
commit | d75049f9785db101d6ecb043a4576652b71da2a7 (patch) | |
tree | d635d19941209e6d9ec8ef89f7d4ce668fc22983 /rsc | |
parent | c7d6541f5daa59d04accb30c727a83d936f02150 (diff) |
rsc: fix how -isystem args are filtered out for the preproc
Change-Id: I7688f3d68be99362e79304bbac041424eee6347a
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/prj/start.cxx | 17 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp3.c | 14 |
2 files changed, 18 insertions, 13 deletions
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx index 7c7cc3288dea..7c926f04d7a5 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -75,6 +75,23 @@ static bool CallPrePro( const OString& rInput, bVerbose = true; continue; } + if (strcmp(static_cast<char *>(pCmdLine->GetEntry(i)), "-isystem") == 0) + { + // ignore "-isystem" and following arg + if (i < int(pCmdLine->GetCount()) - 1) + { + ++i; + } + continue; + } + if (strncmp( + static_cast<char *>(pCmdLine->GetEntry(i)), "-isystem", + strlen("-isystem")) + == 0) + { + // ignore args starting with "-isystem" + continue; + } if ( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-u", 2 ) || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-i", 2 ) || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-d", 2 )) diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c index 023616495d9c..287b2a583d88 100644 --- a/rsc/source/rscpp/cpp3.c +++ b/rsc/source/rscpp/cpp3.c @@ -217,19 +217,7 @@ dooptions(int argc, char** argv) for (i = j = 1; i < argc; i++) { arg = ap = argv[i]; - if (strcmp(arg, "-isystem") == 0) - { - // ignore "-isystem" and following arg - if (i < argc) - { - ++i; - } - } - else if (strncmp(arg, "-isystem", strlen("-isystem")) == 0) - { - // ignore args starting with "-isystem" - } - else if (*ap++ != '-' || *ap == EOS) + if (*ap++ != '-' || *ap == EOS) { argv[j++] = argv[i]; } |