Rafael Garcia-Suarez wrote:
> Thanks, patches applied as change #29509 and #29510.
>
> Note that this also impacts those dual-lived modules:
>
> * PathTools (BTW, any new maintainer yet?)
> * ExtUtils::MM
>
> (Further patch in this thread applied as change #29511 -- impacts
> Storable.)
So that I understand what's going on here... the Win32:: functions have been
removed from miniperl so determining the Windows version in miniperl has become
more complex. Ok, but I cringe a bit at the indirect way the new checks are
written. "If some DynaLoader function exists, then we can use a Win32
function. Else, check some obscure environment variable to determine if its
Win95 or Win32."
How about something more direct...
$IsWin95 = defined &Win32::IsWin95 ? Win32::IsWin95() : !defined
$ENV{SYSTEMROOT};
The outwardly unrelated DynaLoader is completely removed from the equation,
this better future proofs uses of Win32::, and the purpose of using SYSTEMROOT
as a fallback is made plain.
This is what I'm patching into MakeMaker.
--- lib/ExtUtils/MM.pm (revision 26404)
+++ lib/ExtUtils/MM.pm (local)
@@ -43,12 +43,19 @@
sub DESTROY {}
}
+sub _is_win95 {
+ # miniperl might not have the Win32 functions available and we need
+ # to run in miniperl.
+ return defined &Win32::IsWin95 ? Win32::IsWin95()
+ : ! defined $ENV{SYSTEMROOT};
+}
+
my %Is = ();
$Is{VMS} = $^O eq 'VMS';
$Is{OS2} = $^O eq 'os2';
$Is{MacOS} = $^O eq 'MacOS';
if( $^O eq 'MSWin32' ) {
- Win32::IsWin95() ? $Is{Win95} = 1 : $Is{Win32} = 1;
+ _is_win95 ? $Is{Win95} = 1 : $Is{Win32} = 1;
}
$Is{UWIN} = $^O =~ /^uwin(-nt)?$/;
$Is{Cygwin} = $^O eq 'cygwin';
Also, is it necessary to say "use Win32" now?