From: Steve Peters Date: Mon, 30 Oct 2006 00:22:00 +0000 (+0000) Subject: Changes to get perl to compile with g++ on Cygwin. Some additional X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=667e29483278676092af95a151e7ae7d8eb1d304;p=p5sagit%2Fp5-mst-13.2.git Changes to get perl to compile with g++ on Cygwin. Some additional changes will be needed to get it to link though. p4raw-id: //depot/perl@29142 --- diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c index 68a6fcd..69cb5e4 100644 --- a/cygwin/cygwin.c +++ b/cygwin/cygwin.c @@ -57,7 +57,7 @@ do_aspawn (SV *really, void **mark, void **sp) while (++mark <= sp) if (*mark) - *a++ = SvPVx(*mark, n_a); + *a++ = SvPVx((SV *)*mark, n_a); else *a++ = ""; *a = Nullch; @@ -137,7 +137,6 @@ do_spawn (char *cmd) } /* see also Cwd.pm */ -static XS(Cygwin_cwd) { dXSARGS; @@ -156,7 +155,6 @@ XS(Cygwin_cwd) XSRETURN_UNDEF; } -static XS(XS_Cygwin_pid_to_winpid) { dXSARGS; @@ -175,7 +173,6 @@ XS(XS_Cygwin_pid_to_winpid) XSRETURN_UNDEF; } -static XS(XS_Cygwin_winpid_to_pid) { dXSARGS; diff --git a/malloc.c b/malloc.c index a9245e8..988c905 100644 --- a/malloc.c +++ b/malloc.c @@ -2001,12 +2001,12 @@ morecore(register int bucket) } Free_t -Perl_mfree(void *mp) +Perl_mfree(Malloc_t where) { dVAR; register MEM_SIZE size; register union overhead *ovp; - char *cp = (char*)mp; + char *cp = (char*)where; #ifdef PACK_MALLOC u_char bucket; #endif @@ -2324,7 +2324,7 @@ Perl_strdup(const char *s) MEM_SIZE l = strlen(s); char *s1 = (char *)Perl_malloc(l+1); - return CopyD(s, s1, (MEM_SIZE)(l+1), char); + return (char *)CopyD(s, s1, (MEM_SIZE)(l+1), char); } #ifdef PERL_CORE @@ -2347,7 +2347,7 @@ Perl_putenv(char *a) if (l < sizeof(buf)) var = buf; else - var = Perl_malloc(l + 1); + var = (char *)Perl_malloc(l + 1); Copy(a, var, l, char); var[l + 1] = 0; my_setenv(var, val+1); diff --git a/perl.h b/perl.h index 4cb517d..d708f81 100644 --- a/perl.h +++ b/perl.h @@ -1177,6 +1177,10 @@ EXTERN_C char *crypt(const char *, const char *); EXTERN_C char **environ; #endif +#if defined(__CYGWIN__) && defined(__cplusplus) +EXTERN_C char *crypt(const char *, const char *); +#endif + #ifdef SETERRNO # undef SETERRNO /* SOCKS might have defined this */ #endif diff --git a/sv.c b/sv.c index 4f9a625..d6039e8 100644 --- a/sv.c +++ b/sv.c @@ -10434,7 +10434,7 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param) /* fall through */ case SAVEt_COMPPAD: case SAVEt_NSTAB: - sv = POPPTR(ss,ix); + sv = (SV*) POPPTR(ss,ix); TOPPTR(nss,ix) = sv_dup(sv, param); break; case SAVEt_INT: /* int reference */