From b4748376b6239962bd75b743e5a7b14788a2970c Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Mon, 4 Dec 2000 00:24:33 +0000 Subject: [PATCH] Quieten some noise in Win32 builds: - win32.h is included after , so need to set Win32SCK_IS_STDSCK earlier to avoid re-defined noise in XSUB.h - GCC (& MSVC?) have execv(...,const char *const *) so need a cast from char **. p4raw-id: //depot/perlio@7971 --- doio.c | 4 ++-- perl.h | 8 ++++++++ toke.c | 2 +- win32/win32.h | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doio.c b/doio.c index 094bf84..5fc6641 100644 --- a/doio.c +++ b/doio.c @@ -1300,9 +1300,9 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp, if (*PL_Argv[0] != '/') /* will execvp use PATH? */ TAINT_ENV(); /* testing IFS here is overkill, probably */ if (really && *(tmps = SvPV(really, n_a))) - PerlProc_execvp(tmps,PL_Argv); + PerlProc_execvp(tmps,EXEC_ARGV_CAST(PL_Argv)); else - PerlProc_execvp(PL_Argv[0],PL_Argv); + PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv)); if (ckWARN(WARN_EXEC)) Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s", PL_Argv[0], Strerror(errno)); diff --git a/perl.h b/perl.h index 07e3103..562da8a 100644 --- a/perl.h +++ b/perl.h @@ -714,6 +714,10 @@ typedef struct perl_mstats perl_mstats_t; #include +#if defined(WIN32) && (defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI)) +# define WIN32SCK_IS_STDSCK /* don't pull in custom wsock layer */ +#endif + #if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */ # include # if defined(USE_SOCKS) && defined(I_SOCKS) @@ -3442,6 +3446,10 @@ typedef struct am_table_short AMTS; # include /* setproctitle() in some FreeBSDs */ #endif +#ifndef EXEC_ARGV_CAST +#define EXEC_ARGV_CAST(x) x +#endif + /* and finally... */ #define PERL_PATCHLEVEL_H_IMPLICIT #include "patchlevel.h" diff --git a/toke.c b/toke.c index 0c803d4..aa3e64b 100644 --- a/toke.c +++ b/toke.c @@ -2718,7 +2718,7 @@ Perl_yylex(pTHX) else newargv = PL_origargv; newargv[0] = ipath; - PerlProc_execv(ipath, newargv); + PerlProc_execv(ipath, EXEC_ARGV_CAST(newargv)); Perl_croak(aTHX_ "Can't exec %s", ipath); } #endif diff --git a/win32/win32.h b/win32/win32.h index c75566f..1640564 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -554,5 +554,7 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[]; */ #include "win32iop.h" +#define EXEC_ARGV_CAST(x) ((const char *const *) x) + #endif /* _INC_WIN32_PERL5 */ -- 2.7.4