Using native spawnvp if possible

Pavel Roskin proski at
Tue Sep 23 17:59:30 CDT 2003


I'm writing a script to compile some parts of Wine (including wrc) under
mingw.  There is a little problem - mingw (as included with current
Cygwin) defines function spawnvp() differently:

_CRTIMP int __cdecl spawnvp (int, const char*, const char* const*);

Wine defines it as

extern int spawnvp(int mode, const char *cmdname, char *const argv[]);

Search for "spawnvp" on Google shows that we cannot just fix Wine's
definition to match mingw.  QNX Neutrino used the same prototype as Wine:

I think the best approach would be to use spawnvp() as is it it's already
present in the C library.  Following patch has been successfully tested on
Red Hat 9 and Cygwin+mingw.


	include/wine/port.h, libs/port/spawn.c:
	Don't redefine spawnvp() if it's present in the C library.
	Test for spawnvp().

Make sure to rerun autoconf and autoheader after applying the patch.

Pavel Roskin

More information about the wine-patches mailing list