On Thu, Jun 12, 2003 at 03:40:09PM +0100, Joel Bernstein wrote:
> This hit the gtk-perl list, and looks really damn useful for all XS
> developers. I'm certainly going to give it a whirl, because xsubpp error
> reporting is Broken and Wrong, currently.
> 
> I'm hoping mutt will DTRT with forwarding the .patch attachment.

Which, of course, it didn't. Attaching it now.

/joel
--- /usr/lib/perl5/5.8.0/ExtUtils/xsubpp.orig   2002-09-02 00:14:22.000000000 -0400
+++ /usr/lib/perl5/5.8.0/ExtUtils/xsubpp        2003-06-12 10:22:47.000000000 -0400
@@ -178,9 +178,12 @@
        or ($dir, $filename) = $ARGV[0] =~ m#(.*)\\(.*)#
        or ($dir, $filename) = $ARGV[0] =~ m#(.*[>\]])(.*)#
        or ($dir, $filename) = ('.', $ARGV[0]);
-chdir($dir);
+#chdir($dir);
 $pwd = cwd();
 
+# fix bad line number directives...
+$filename = $dir.'/'.$filename;
+
 ++ $IncludedFiles{$ARGV[0]} ;
 
 my(@XSStack) = ({type => 'none'});     # Stack of conditionals and INCLUDEs
@@ -1647,7 +1650,10 @@
     # work out the line number
     my $line_no = [EMAIL PROTECTED] - @line -1] ;
 
-    print STDERR "@_ in $filename, line $line_no\n" ;
+#    print STDERR "@_ in $filename, line $line_no\n" ;
+    # standard compiler output format, to work with things that parse
+    # compiler errors and take you to them, e.g. vim and emacs
+    print STDERR "$filename:$line_no: @_\n" ;
 }
 
 sub blurt

Reply via email to