[Mono-list] Patch for gtk-sharp/codegen/defs-parse.pl

David Dawkins david@dawkins.st
Sun, 30 Dec 2001 19:17:51 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_0052_01C19166.AC8E4060
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This patch deals with the '\r' characters encountered on Cygwin
systems where the filesystem is mounted in "textmode". 

Without this patch, defs-parse.pl generates garbage for 
glib/generated/voidSignal.cs.

Regards,
David Dawkins

------=_NextPart_000_0052_01C19166.AC8E4060
Content-Type: text/plain;
	name="patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="patch.txt"

Index: defs-parse.pl
===================================================================
RCS file: /mono/gtk-sharp/codegen/defs-parse.pl,v
retrieving revision 1.15
diff -u -r1.15 defs-parse.pl
--- defs-parse.pl	4 Dec 2001 19:34:26 -0000	1.15
+++ defs-parse.pl	30 Dec 2001 19:12:40 -0000
@@ -35,6 +35,7 @@
 		$name = $1;
 		$def =~ /c-name "(\w+)"/;
 		$cname=$1;
+		$def =~ s/\r*//g;
 		$def =~ s/\n\s*//g;
 		$structs{$cname} = $def;
 		$maptypes{$cname} = $name;
@@ -43,6 +44,7 @@
 		$name = $1;
 		$def =~ /c-name "(\w+)"/;
 		$cname=$1;
+		$def =~ s/\r*//g;
 		$def =~ s/\n\s*//g;
 		$objects{$cname} = $def;
 		$maptypes{$cname} = $name;
@@ -50,11 +52,13 @@
 	} elsif ($def =~ /^\(define-(prop|signal|method)/) {
 		$def =~ /of-object "(\w+)"/;
 		$cname=$1;
+		$def =~ s/\r*//g;
 		$def =~ s/\n\s*//g;
 		$objects{$cname} .= "\n$def";
 	} elsif ($def =~ /^\(define-function/) {
 		if ($def =~ /is-constructor-of (\w+)\)/) {
 			$cname=$1;
+			$def =~ s/\r*//g;
 			$def =~ s/\n\s*//g;
 			$objects{$cname} .= "\n$def";
 		}

------=_NextPart_000_0052_01C19166.AC8E4060--