mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-27 13:48:45 +03:00
fix qjsc for Windows
This commit is contained in:
parent
db3d3f09cd
commit
7709f98eb6
13
qjsc.c
13
qjsc.c
@ -374,10 +374,20 @@ void help(void)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_CC) && !defined(_WIN32)
|
#if defined(CONFIG_CC)
|
||||||
|
|
||||||
int exec_cmd(char **argv)
|
int exec_cmd(char **argv)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = _spawnvp(_P_WAIT, argv[0], (const char * const *)argv);
|
||||||
|
if (ret == -1) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
#else
|
||||||
int pid, status, ret;
|
int pid, status, ret;
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
@ -392,6 +402,7 @@ int exec_cmd(char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return WEXITSTATUS(status);
|
return WEXITSTATUS(status);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int output_executable(const char *out_filename, const char *cfilename,
|
static int output_executable(const char *out_filename, const char *cfilename,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user