Skip to content

Commit b474837

Browse files
author
Nick Ing-Simmons
committed
Quieten some noise in Win32 builds:
- win32.h is included after <sys/socket.h>, 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
1 parent adb7145 commit b474837

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

doio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,9 +1300,9 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
13001300
if (*PL_Argv[0] != '/') /* will execvp use PATH? */
13011301
TAINT_ENV(); /* testing IFS here is overkill, probably */
13021302
if (really && *(tmps = SvPV(really, n_a)))
1303-
PerlProc_execvp(tmps,PL_Argv);
1303+
PerlProc_execvp(tmps,EXEC_ARGV_CAST(PL_Argv));
13041304
else
1305-
PerlProc_execvp(PL_Argv[0],PL_Argv);
1305+
PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv));
13061306
if (ckWARN(WARN_EXEC))
13071307
Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s",
13081308
PL_Argv[0], Strerror(errno));

perl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ typedef struct perl_mstats perl_mstats_t;
714714

715715
#include <errno.h>
716716

717+
#if defined(WIN32) && (defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI))
718+
# define WIN32SCK_IS_STDSCK /* don't pull in custom wsock layer */
719+
#endif
720+
717721
#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
718722
# include <sys/socket.h>
719723
# if defined(USE_SOCKS) && defined(I_SOCKS)
@@ -3442,6 +3446,10 @@ typedef struct am_table_short AMTS;
34423446
# include <libutil.h> /* setproctitle() in some FreeBSDs */
34433447
#endif
34443448

3449+
#ifndef EXEC_ARGV_CAST
3450+
#define EXEC_ARGV_CAST(x) x
3451+
#endif
3452+
34453453
/* and finally... */
34463454
#define PERL_PATCHLEVEL_H_IMPLICIT
34473455
#include "patchlevel.h"

toke.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ Perl_yylex(pTHX)
27182718
else
27192719
newargv = PL_origargv;
27202720
newargv[0] = ipath;
2721-
PerlProc_execv(ipath, newargv);
2721+
PerlProc_execv(ipath, EXEC_ARGV_CAST(newargv));
27222722
Perl_croak(aTHX_ "Can't exec %s", ipath);
27232723
}
27242724
#endif

win32/win32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,5 +554,7 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[];
554554
*/
555555
#include "win32iop.h"
556556

557+
#define EXEC_ARGV_CAST(x) ((const char *const *) x)
558+
557559
#endif /* _INC_WIN32_PERL5 */
558560

0 commit comments

Comments
 (0)