From: Blair Zajac Date: Fri, 6 Mar 1998 10:29:29 +0000 (-0800) Subject: PATCH: util.c and util.h function declarations do not match X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e9cb6d146cf75820a5771a80b499a65f1217c427;p=p5sagit%2Fp5-mst-13.2.git PATCH: util.c and util.h function declarations do not match Date: Fri, 6 Mar 1998 10:29:29 -0800 (PST) Subject: PATCH: cgywin32 patch for perlgcc Date: Fri, 6 Mar 1998 11:15:36 -0800 (PST) Subject: PATCH: perl5.004_62 on cygwin32 Date: Fri, 6 Mar 1998 11:57:35 -0800 (PST) p4raw-id: //depot/perl@813 --- diff --git a/cygwin32/perlgcc b/cygwin32/perlgcc index 97d7d1a..dbb9962 100644 --- a/cygwin32/perlgcc +++ b/cygwin32/perlgcc @@ -30,21 +30,21 @@ $libflagString = join(" ",@libFlags); # make exports file my $command = "echo EXPORTS > perl.def"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; $command ="nm $libstring | grep '^........ [TCD] _'| grep -v _impure_ptr | sed 's/[^_]*_//' >> perl.def"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; # Build the perl.a lib to link to: $command ="dlltool --as=as --dllname perl.exe --def perl.def --output-lib perl.a"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; # change name of export lib to libperlexp so that is can be understood by ld2/perlld $command ="mv perl.a libperlexp.a"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; # get the full path name of a few libs: my $crt0 = `gcc -print-file-name=crt0.o`; @@ -53,25 +53,39 @@ my $libdir = `gcc -print-file-name=libcygwin.a`; chomp $libdir; $libdir =~ s/libcygwin\.a//g; +# when $crt0 and $libdir get used in the system calls below, the \'s +# from the gcc -print-file-name get used to create special characters, +# such as \n, \t. Replace the \'s with /'s so that this does not +# happen: +$crt0 =~ s:\\:/:g; +$libdir =~ s:\\:/:g; + +# when $crt0 and $libdir get used in the system calls below, the \'s +# from the gcc -print-file-name get used to create special characters, +# such as \n, \t. Replace the \'s with /'s so that this does not +# happen: +$crt0 =~ s:\\:/:g; +$libdir =~ s:\\:/:g; + # Link exe: $command = "ld --base-file perl.base -o perl.exe $crt0 $obsString $libstring -L$libdir $libflagString"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; $command = "dlltool --as=as --dllname perl.exe --def perl.def --base-file perl.base --output-exp perl.exp"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; $command = "ld --base-file perl.base perl.exp -o perl.exe $crt0 $obsString $libstring -L$libdir $libflagString"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; $command = "dlltool --as=as --dllname perl.exe --def perl.def --base-file perl.base --output-exp perl.exp"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; $command = "ld perl.exp -o perl.exe $crt0 $obsString $libstring -L$libdir $libflagString"; print "$command\n"; -system($command); +system($command) == 0 or die "system() failed.\n"; print "perlgcc: Completed\n"; diff --git a/cygwin32/perlld b/cygwin32/perlld index 1622f2f..97edfd6 100644 --- a/cygwin32/perlld +++ b/cygwin32/perlld @@ -47,54 +47,54 @@ if( $args=~/\-o (.+?)\.dll/i){ writeInit(); $command = "gcc -c $fixup.c\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "gcc -c $init.cc\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "echo EXPORTS > $libname.def\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "nm ".join(" ",@objs)." $init.o $fixup.o | grep '^........ [TCD] _' | sed 's/[^_]*_//' >> $libname.def\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "ld --base-file $libname.base --dll -o $libname.dll ".join(" ",@objs)." $init.o $fixup.o "; $command .= join(" ",@flags)." -e _dll_entry\@12 \n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "dlltool --as=as --dllname $libname.dll --def $libname.def --base-file $libname.base --output-exp $libname.exp\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "ld --base-file $libname.base $libname.exp --dll -o $libname.dll ".join(" ",@objs)." $init.o $fixup.o "; $command .= join(" ",@flags)." -e _dll_entry\@12 \n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "dlltool --as=as --dllname $libname.dll --def $libname.def --base-file $libname.base --output-exp $libname.exp\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "ld $libname.exp --dll -o $libname.dll ".join(" ",@objs)." $init.o $fixup.o "; $command .= join(" ",@flags)." -e _dll_entry\@12 \n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; print "Build the import lib\n"; $command = "dlltool --as=as --dllname $libname.dll --def $libname.def --output-lib $libname.a\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; # if there was originally a path, copy the dll and a to that location: if($path && $path ne "./" && $path."\n" ne "`pwd`"){ $command = "mv $libname.dll $path".$libname.".dll\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; $command = "mv $libname.a $path".$libname.".a\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; } @@ -102,7 +102,7 @@ if( $args=~/\-o (.+?)\.dll/i){ else{ # no special processing, just call ld $command = "ld $args\n"; print $command; - system($command); + system($command) == 0 or die "system() failed.\n"; } #--------------------------------------------------------------------------- diff --git a/x2p/util.c b/x2p/util.c index 3d3b99a..f8e342c 100644 --- a/x2p/util.c +++ b/x2p/util.c @@ -24,7 +24,7 @@ static char nomem[] = "Out of memory!\n"; Malloc_t -safemalloc(size_t size) +safemalloc(MEM_SIZE size) { Malloc_t ptr; @@ -47,7 +47,7 @@ safemalloc(size_t size) /* paranoid version of realloc */ Malloc_t -saferealloc(void *where, size_t size) +saferealloc(Malloc_t where, MEM_SIZE size) { Malloc_t ptr; @@ -71,7 +71,7 @@ saferealloc(void *where, size_t size) /* safe version of free */ Free_t -safefree(void *where) +safefree(Malloc_t where) { #ifdef DEBUGGING if (debug & 128)