3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-12 16:28:17 +00:00

use latest win python launcher from yosys

This commit is contained in:
Ed Bordin 2020-07-08 13:02:53 +10:00
parent 06e80194c7
commit 49b6875ab5

11
extern/launcher.c vendored
View file

@ -61,10 +61,11 @@ SOFTWARE. */
#include <windows.h> #include <windows.h>
#include <tchar.h> #include <tchar.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
int child_pid=0; 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 */ /* Print error message to stderr and return 2 */
fprintf(stderr, format, data); fprintf(stderr, format, data);
return 2; return 2;
@ -75,7 +76,7 @@ char *quoted(char *data) {
/* We allocate twice as much space as needed to deal with worse-case /* We allocate twice as much space as needed to deal with worse-case
of having to escape everything. */ 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; char *presult = result;
*presult++ = '"'; *presult++ = '"';
@ -119,7 +120,7 @@ char *loadable_exe(char *exename) {
if (!hPython) return NULL; */ if (!hPython) return NULL; */
/* Return the absolute filename for spawnv */ /* Return the absolute filename for spawnv */
result = calloc(MAX_PATH, sizeof(char)); result = (char *)calloc(MAX_PATH, sizeof(char));
strncpy(result, exename, MAX_PATH); strncpy(result, exename, MAX_PATH);
/*if (result) GetModuleFileNameA(hPython, result, MAX_PATH); /*if (result) GetModuleFileNameA(hPython, result, MAX_PATH);
@ -157,7 +158,7 @@ char **parse_argv(char *cmdline, int *argc)
{ {
/* Parse a command line in-place using MS C rules */ /* 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 *output = cmdline;
char c; char c;
int nb = 0; int nb = 0;
@ -338,7 +339,7 @@ int run(int argc, char **argv, int is_gui) {
if (is_gui) { if (is_gui) {
/* Use exec, we don't need to wait for the GUI to finish */ /* 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! */ return fail("Could not exec %s", ptr); /* shouldn't get here! */
} }