This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix compilation errors in win32.c with MinGW/gcc -xc++
authorSteve Hay <steve.m.hay@googlemail.com>
Sat, 20 Dec 2014 13:05:30 +0000 (13:05 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Wed, 24 Dec 2014 13:20:06 +0000 (13:20 +0000)
commit8fdfe84a7f78d727c928bb1d09cc1e31b2dd689d
tree088f86166a182fe0b5fcdb9e6616b688e57bb682
parent1271a1bef9e811fe58a09dbdc00ddfdf292f686b
Fix compilation errors in win32.c with MinGW/gcc -xc++

In MinGW-w64 builds, there are warnings/errors like this (depending on the
compiler version used):

gcc-4.5.3:
warning: passing argument 2 of 'execv' from incompatible pointer type

gcc-4.8.0:
error: invalid conversion from 'const char* const*' to 'char* const*'

This happens because MinGW-w64's process.h declares execv/execvp's second
argument as 'char * const*' instead of 'const char * const*'.
The _execv/_execvp versions don't have this problem so use them instead.
MSDN says execv/execvp are deprecated POSIX functions; use the ISO C++
conformant _execv/_execvp instead anyway so it is not even worth sticking
with execv/execvp for those compilers (namely, MinGW and VC++) that have
the correct declarations.

Likewise with spawnv/spawnvp vs. _spawnv/_spawnvp.
win32/win32.c