Skip to content

Commit

Permalink
Quieten some noise in Win32 builds:
Browse files Browse the repository at this point in the history
 - 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
  • Loading branch information
Nick Ing-Simmons committed Dec 4, 2000
1 parent adb7145 commit b474837
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doio.c
Expand Up @@ -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));
Expand Down
8 changes: 8 additions & 0 deletions perl.h
Expand Up @@ -714,6 +714,10 @@ typedef struct perl_mstats perl_mstats_t;

#include <errno.h>

#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 <sys/socket.h>
# if defined(USE_SOCKS) && defined(I_SOCKS)
Expand Down Expand Up @@ -3442,6 +3446,10 @@ typedef struct am_table_short AMTS;
# include <libutil.h> /* 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"
Expand Down
2 changes: 1 addition & 1 deletion toke.c
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions win32/win32.h
Expand Up @@ -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 */

0 comments on commit b474837

Please sign in to comment.