diff options
Diffstat (limited to 'tools/pidl/idl.yp')
-rw-r--r-- | tools/pidl/idl.yp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/tools/pidl/idl.yp b/tools/pidl/idl.yp index 08f982a9..8889632b 100644 --- a/tools/pidl/idl.yp +++ b/tools/pidl/idl.yp @@ -680,12 +680,29 @@ sub parse_file($$) undef $/; my $cpp = $ENV{CPP}; my $options = ""; - if (! defined $cpp) { - if (defined $ENV{CC}) { - $cpp = "$ENV{CC}"; - $options = "-E"; - } else { - $cpp = "cpp"; + if ($^O eq "MSWin32") { + $cpp = "cpp"; + }else{ + if (! defined $cpp) { + if (defined $ENV{CC}) { + $cpp = "$ENV{CC}"; + $options = "-E"; + } else { + # + # If cc is Clang-based don't use cpp, as + # at least some versions of Clang, cpp + # doesn't strip // comments, but cc -E + # does. + # + + my $cc_version = `cc --version`; + if ($cc_version =~ /clang/) { + $cpp = "cc"; + $options = "-E" + } else { + $cpp = "cpp"; + } + } } } my $includes = join('',map { " -I$_" } @$incdirs); |