summaryrefslogtreecommitdiff
path: root/ext/Errno
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-06-30 07:57:25 +0000
committerSteve Hay <SteveHay@planit.com>2005-06-30 07:57:25 +0000
commit1e92bf58d9ca015d8f610db7bf0ee9de90ff39ff (patch)
tree5742bdb456ab03b5f7073a254232db7e1e99c493 /ext/Errno
parentadebf063a6864629503e4bb09e346b3b421b98ac (diff)
downloadperl-1e92bf58d9ca015d8f610db7bf0ee9de90ff39ff.tar.gz
Silence MinGW warnings about system headers when building Errno
Thanks to Mike Guy for the suggested fix. p4raw-id: //depot/perl@25014
Diffstat (limited to 'ext/Errno')
-rw-r--r--ext/Errno/Errno_pm.PL22
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index 5c76d89057..bd87f6221d 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -16,8 +16,24 @@ unlink "Errno.pm" if -f "Errno.pm";
open OUT, ">Errno.pm" or die "Cannot open Errno.pm: $!";
select OUT;
my $file;
-foreach $file (get_files()) {
- process_file($file);
+my @files = get_files();
+if ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
+ # MinGW complains "warning: #pragma system_header ignored outside include
+ # file" if the header files are processed individually, so include them
+ # all in .c file and process that instead.
+ open INCS, '>includes.c' or
+ die "Cannot open includes.c";
+ foreach $file (@files) {
+ print INCS qq[#include "$file"\n];
+ }
+ close INCS;
+ process_file('includes.c');
+ unlink 'includes.c';
+}
+else {
+ foreach $file (@files) {
+ process_file($file);
+ }
}
write_errno_pm();
unlink "errno.c" if -f "errno.c";
@@ -178,6 +194,8 @@ sub get_files {
if (/$pat/o) {
my $f = $1;
$f =~ s,\\\\,/,g;
+ next if $f eq 'errno.c';
+ next unless -f $f;
$file{$f} = 1;
}
}