#include <windows.h>
#include <tchar.h>
#include <fcntl.h>
+#include <unistd.h>
int child_pid=0;
-int fail(char *format, char *data) {
+int fail(const char *format, const char *data) {
/* Print error message to stderr and return 2 */
fprintf(stderr, format, data);
return 2;
/* We allocate twice as much space as needed to deal with worse-case
of having to escape everything. */
- char *result = calloc(ln*2+3, sizeof(char));
+ char *result = (char *)calloc(ln*2+3, sizeof(char));
char *presult = result;
*presult++ = '"';
if (!hPython) return NULL; */
/* Return the absolute filename for spawnv */
- result = calloc(MAX_PATH, sizeof(char));
+ result = (char *)calloc(MAX_PATH, sizeof(char));
strncpy(result, exename, MAX_PATH);
/*if (result) GetModuleFileNameA(hPython, result, MAX_PATH);
{
/* Parse a command line in-place using MS C rules */
- char **result = calloc(strlen(cmdline), sizeof(char *));
+ char **result = (char **)calloc(strlen(cmdline), sizeof(char *));
char *output = cmdline;
char c;
int nb = 0;
if (is_gui) {
/* Use exec, we don't need to wait for the GUI to finish */
- execv(ptr, (const char * const *)(newargs));
+ execv(ptr, (char * const *)(newargs));
return fail("Could not exec %s", ptr); /* shouldn't get here! */
}