On Mon, 18 Dec 2006 15:10:39 -0500, Michael G Schwern <[EMAIL PROTECTED]> wrote:

>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}; 
>+}
>+


Here is an implementation that is less obscure and also works with the
current implementation:

sub _is_win95 {
    return 0 unless $^O eq "MSWin32";
    # Win32::* functions are not operational under miniperl because
    # they use the DynaLoader to load the real implementation.
    my $is95 = eval { Win32::IsWin95() };
    if ($@) {
        # The SYSTEMROOT environment variable is only set by
        # Windows NT and later.
        $is95 = !defined $ENV{SYSTEMROOT};
    }
    return $is95;
}

Cheers,
-Jan

Reply via email to