1
2 diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
3 index 3dadfce..c6bfa06 100644
4 --- a/ext/Errno/Errno_pm.PL
5 +++ b/ext/Errno/Errno_pm.PL
6 @@ -215,20 +215,31 @@ sub write_errno_pm {
7 { # BeOS (support now removed) did not enter this block
8 # invoke CPP and read the output
9
10 + my $inhibit_linemarkers = '';
11 + if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) {
12 + # GCC 5.0 interleaves expanded macros with line numbers breaking
13 + # each line into multiple lines. RT#123784
14 + $inhibit_linemarkers = ' -P';
15 + }
16 +
17 if ($^O eq 'VMS') {
18 - my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}";
19 + my $cpp = "$Config{cppstdin} $Config{cppflags}" .
20 + $inhibit_linemarkers . " $Config{cppminus}";
21 $cpp =~ s/sys\$input//i;
22 open(CPPO,"$cpp errno.c |") or
23 die "Cannot exec $Config{cppstdin}";
24 } elsif ($IsMSWin32 || $^O eq 'NetWare') {
25 - open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
26 - die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
27 + my $cpp = "$Config{cpprun} $Config{cppflags}" .
28 + $inhibit_linemarkers;
29 + open(CPPO,"$cpp errno.c |") or
30 + die "Cannot run '$cpp errno.c'";
31 } elsif ($IsSymbian) {
32 - my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc -";
33 + my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc" .
34 + $inhibit_linemarkers ." -";
35 open(CPPO,"$cpp < errno.c |")
36 or die "Cannot exec $cpp";
37 } else {
38 - my $cpp = default_cpp();
39 + my $cpp = default_cpp() . $inhibit_linemarkers;
40 open(CPPO,"$cpp < errno.c |")
41 or die "Cannot exec $cpp";
42 }