Change 27984 by [EMAIL PROTECTED] on 2006/04/27 18:09:09

        Integrate:
        [ 24820]
        Make some variables global, to avoid some "will not stay
        shared" warnings at compile time
        
        [ 25222]
        Make CBuilder and ParseXS clean up their temp test files
        
        [ 25225]
        Ken pointed out that CBuilder's cleanup is too agrressive
        
        The Windows compile() and link() methods bizarrely include their own
        output files in the list of files to be cleaned up.  Now that they
        actually are being cleaned up, this isn't ideal ;-)
        
        Stop compile() and link() from cleaning up their own output, and
        reinstate the explicit deletion of those output files in the test
        scripts.
        
        [ 25533]
        Upgrade to ExtUtils::ParseXS 2.12
        
        [ 25690]
        Upgrade to ExtUtils-ParseXS-2.13
        
        [ 25722]
        Upgraded to ExtUtils-ParseXS-2.14.
        
        [ 25764]
        Upgrade to ExtUtils-ParseXS-2.15.

Affected files ...

... //depot/maint-5.8/perl/lib/ExtUtils/ParseXS.pm#4 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/ParseXS/t/basic.t#2 integrate

Differences ...

==== //depot/maint-5.8/perl/lib/ExtUtils/ParseXS.pm#4 (text) ====
Index: perl/lib/ExtUtils/ParseXS.pm
--- perl/lib/ExtUtils/ParseXS.pm#3~27981~       2006-04-27 10:48:33.000000000 
-0700
+++ perl/lib/ExtUtils/ParseXS.pm        2006-04-27 11:09:09.000000000 -0700
@@ -5,6 +5,7 @@
 use Config;
 use File::Basename;
 use File::Spec;
+use Symbol;
 
 require Exporter;
 
@@ -17,7 +18,7 @@
 my($XSS_work_idx, $cpp_next_tmp);
 
 use vars qw($VERSION);
-$VERSION = '2.10';
+$VERSION = '2.15';
 
 use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re 
$Overload $errors $Fallback
            $cplusplus $hiertype $WantPrototypes $WantVersionChk $except 
$WantLineNumbers
@@ -71,7 +72,7 @@
   @XSStack = ({type => 'none'});
   ($XSS_work_idx, $cpp_next_tmp) = (0, "XSubPPtmpAAAA");
   @InitFileCode = ();
-  $FH = 'File0000' ;
+  $FH = Symbol::gensym();
   $proto_re = "[" . quotemeta('\$%&*@;[]') . "]" ;
   $Overload = 0;
   $errors = 0;
@@ -196,8 +197,8 @@
     $input_expr{$key} =~ s/;*\s+\z//;
   }
 
-  my ($bal, $cast, $size);
-  $bal = qr[(?:(?>[^()]+)|\((??{ $bal })\))*]; # ()-balanced
+  my ($cast, $size);
+  our $bal = qr[(?:(?>[^()]+)|\((??{ $bal })\))*]; # ()-balanced
   $cast = qr[(?:\(\s*SV\s*\*\s*\)\s*)?]; # Optional (SV*) cast
   $size = qr[,\s* (??{ $bal }) ]x; # Third arg (to setpvn)
 
@@ -225,7 +226,7 @@
                                  )) . "|$END)\\s*:";
 
   
-  my ($C_group_rex, $C_arg);
+  our ($C_group_rex, $C_arg);
   # Group in C (no support for comments or literals)
   $C_group_rex = qr/ [({\[]
                       (?: (?> [^()\[\]{}]+ ) | (??{ $C_group_rex }) )*
@@ -983,6 +984,7 @@
   chdir($orig_cwd);
   select($orig_fh);
   untie *PSEUDO_STDOUT if tied *PSEUDO_STDOUT;
+  close $FH;
 
   return 1;
 }
@@ -1439,7 +1441,7 @@
                    Handle          => $FH,
                   }) ;
 
-    ++ $FH ;
+    $FH = Symbol::gensym();
 
     # open the new file
     open ($FH, "$_") or death("Cannot open '$_': $!") ;

==== //depot/maint-5.8/perl/lib/ExtUtils/ParseXS/t/basic.t#2 (text) ====
Index: perl/lib/ExtUtils/ParseXS/t/basic.t
--- perl/lib/ExtUtils/ParseXS/t/basic.t#1~27981~        2006-04-27 
10:48:33.000000000 -0700
+++ perl/lib/ExtUtils/ParseXS/t/basic.t 2006-04-27 11:09:09.000000000 -0700
@@ -11,6 +11,7 @@
 use strict;
 use Test;
 BEGIN { plan tests => 10 };
+use DynaLoader;
 use ExtUtils::ParseXS qw(process_file);
 use ExtUtils::CBuilder;
 ok(1); # If we made it this far, we're loaded.
@@ -26,9 +27,11 @@
 process_file( filename => 'XSTest.xs', output => \*FH, prototypes => 1 );
 ok tied(*FH)->content, '/is_even/', "Test that output contains some text";
 
+my $source_file = 'XSTest.c';
+
 # Try sending to file
-process_file( filename => 'XSTest.xs', output => 'XSTest.c', prototypes => 0 );
-ok -e 'XSTest.c', 1, "Create an output file";
+process_file(filename => 'XSTest.xs', output => $source_file, prototypes => 0);
+ok -e $source_file, 1, "Create an output file";
 
 # TEST doesn't like extraneous output
 my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
@@ -38,7 +41,7 @@
 if ($b->have_compiler) {
   my $module = 'XSTest';
 
-  my $obj_file = $b->compile( source => "$module.c" );
+  my $obj_file = $b->compile( source => $source_file );
   ok $obj_file;
   ok -e $obj_file, 1, "Make sure $obj_file exists";
 
@@ -51,10 +54,23 @@
   ok  XSTest::is_even(8);
   ok !XSTest::is_even(9);
 
+  # Win32 needs to close the DLL before it can unlink it, but unfortunately
+  # dl_unload_file was missing on Win32 prior to perl change #24679!
+  if ($^O eq 'MSWin32' and defined &DynaLoader::dl_unload_file) {
+    for (my $i = 0; $i < @DynaLoader::dl_modules; $i++) {
+      if ($DynaLoader::dl_modules[$i] eq $module) {
+        DynaLoader::dl_unload_file($DynaLoader::dl_librefs[$i]);
+        last;
+      }
+    }
+  }
+  1 while unlink $lib_file;
 } else {
-  skip "Skipped can't find a C compiler & linker", 1 for 1..6;
+  skip "Skipped can't find a C compiler & linker", 1 for 1..7;
 }
 
+1 while unlink $source_file;
+
 #####################################################################
 
 sub Foo::TIEHANDLE { bless {}, 'Foo' }
End of Patch.

Reply via email to