From: Jarkko Hietaniemi Date: Wed, 24 Apr 2002 18:30:14 +0000 (+0000) Subject: Integrate #16136, #16137, #16138 from macperl; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bcdb689b03b8acb5fc82d7d93ba3efa5babb480a;p=p5sagit%2Fp5-mst-13.2.git Integrate #16136, #16137, #16138 from macperl; Silly fix for the SC compiler's fixation with "comp" as a type Skip more PerlIO symbols for sfio Play nicely in miniperl p4raw-id: //depot/perl@16142 p4raw-integrated: from //depot/macperl@16132 'copy in' ext/Unicode/Normalize/Normalize.xs lib/File/Copy.pm lib/File/Spec/Mac.pm makedef.pl (@16123..) --- diff --git a/ext/Unicode/Normalize/Normalize.xs b/ext/Unicode/Normalize/Normalize.xs index 3cb221f..93cb471 100644 --- a/ext/Unicode/Normalize/Normalize.xs +++ b/ext/Unicode/Normalize/Normalize.xs @@ -553,10 +553,10 @@ getComposite(uv, uv2) UV uv2 PROTOTYPE: $$ PREINIT: - UV comp; + UV composite; CODE: - comp = composite_uv(uv, uv2); - RETVAL = comp ? newSVuv(comp) : &PL_sv_undef; + composite = composite_uv(uv, uv2); + RETVAL = composite ? newSVuv(composite) : &PL_sv_undef; OUTPUT: RETVAL diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 31fad2a..08da5e5 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -33,6 +33,13 @@ require Exporter; $Too_Big = 1024 * 1024 * 2; +my $macfiles; +if ($^O eq 'MacOS') { + $macfiles = eval { require Mac::MoreFiles }; + warn 'Mac::MoreFiles could not be loaded; using non-native syscopy' + if $^W; +} + sub _catname { my($from, $to) = @_; if (not defined &basename) { @@ -230,8 +237,7 @@ unless (defined &syscopy) { return 0 unless @_ == 2; return Win32::CopyFile(@_, 1); }; - } elsif ($^O eq 'MacOS') { - require Mac::MoreFiles; + } elsif ($macfiles) { *syscopy = sub { my($from, $to) = @_; my($dir, $toname); @@ -338,6 +344,9 @@ VMS systems, this calls the C routine (see below). For OS/2 systems, this calls the C XSUB directly. For Win32 systems, this calls C. +On Mac OS (Classic), C calls C, +if available. + =head2 Special behaviour if C is defined (OS/2, VMS and Win32) If both arguments to C are not file handles, diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm index c3ae7af..000da91 100644 --- a/lib/File/Spec/Mac.pm +++ b/lib/File/Spec/Mac.pm @@ -9,6 +9,10 @@ $VERSION = '1.3'; @ISA = qw(File::Spec::Unix); use Cwd; +my $macfiles; +if ($^O eq 'MacOS') { + $macfiles = eval { require Mac::Files }; +} =head1 NAME @@ -339,6 +343,8 @@ concept, although other volumes aren't rooted there. The name has a trailing ":", because that's the correct specification for a volume name on Mac OS. +If Mac::Files could not be loaded, the empty string is returned. + =cut sub rootdir { @@ -346,9 +352,9 @@ sub rootdir { # There's no real root directory on Mac OS. The name of the startup # volume is returned, since that's the closest in concept. # - require Mac::Files; - my $system = Mac::Files::FindFolder(&Mac::Files::kOnSystemDisk, - &Mac::Files::kSystemFolderType); + return '' unless $macfiles; + my $system = Mac::Files::FindFolder(&Mac::Files::kOnSystemDisk, + &Mac::Files::kSystemFolderType); $system =~ s/:.*\Z(?!\n)/:/s; return $system; } diff --git a/makedef.pl b/makedef.pl index 330d6a2..4ee99f3 100644 --- a/makedef.pl +++ b/makedef.pl @@ -769,6 +769,29 @@ if ($define{'USE_PERLIO'}) { PerlIO_ungetc PerlIO_vprintf PerlIO_write + PerlIO_perlio + Perl_PerlIO_clearerr + Perl_PerlIO_close + Perl_PerlIO_eof + Perl_PerlIO_error + Perl_PerlIO_fileno + Perl_PerlIO_fill + Perl_PerlIO_flush + Perl_PerlIO_get_base + Perl_PerlIO_get_bufsiz + Perl_PerlIO_get_cnt + Perl_PerlIO_get_ptr + Perl_PerlIO_read + Perl_PerlIO_seek + Perl_PerlIO_set_cnt + Perl_PerlIO_set_ptrcnt + Perl_PerlIO_setlinebuf + Perl_PerlIO_stderr + Perl_PerlIO_stdin + Perl_PerlIO_stdout + Perl_PerlIO_tell + Perl_PerlIO_unread + Perl_PerlIO_write )]; } } else {