| author | |
| committer | |
| log | 21dff1c4e280663c7a637f3b014c0d7326efcd3d |
| tree | e6662c17622f430e758ac5210658dca9765c218a |
| parent | d5d0942a0dd5366e7e9a0843bf40878e6f0e1f2c |
6 files changed, 49 insertions(+), 51 deletions(-)
src/codegen.cpp+2-1| ... | @@ -8801,6 +8801,7 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { | ... | @@ -8801,6 +8801,7 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { |
| 8801 | 8801 | ||
| 8802 | Termination term; | 8802 | Termination term; |
| 8803 | ZigList<const char *> args = {}; | 8803 | ZigList<const char *> args = {}; |
| 8804 | args.append(buf_ptr(self_exe_path)); | ||
| 8804 | args.append("cc"); | 8805 | args.append("cc"); |
| 8805 | 8806 | ||
| 8806 | Buf *out_dep_path = buf_sprintf("%s.d", buf_ptr(out_obj_path)); | 8807 | Buf *out_dep_path = buf_sprintf("%s.d", buf_ptr(out_obj_path)); |
| ... | @@ -8819,7 +8820,7 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { | ... | @@ -8819,7 +8820,7 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { |
| 8819 | if (g->verbose_cc) { | 8820 | if (g->verbose_cc) { |
| 8820 | print_zig_cc_cmd("zig", &args); | 8821 | print_zig_cc_cmd("zig", &args); |
| 8821 | } | 8822 | } |
| 8822 | os_spawn_process(buf_ptr(self_exe_path), args, &term); | 8823 | os_spawn_process(args, &term); |
| 8823 | if (term.how != TerminationIdClean || term.code != 0) { | 8824 | if (term.how != TerminationIdClean || term.code != 0) { |
| 8824 | fprintf(stderr, "\nThe following command failed:\n"); | 8825 | fprintf(stderr, "\nThe following command failed:\n"); |
| 8825 | print_zig_cc_cmd(buf_ptr(self_exe_path), &args); | 8826 | print_zig_cc_cmd(buf_ptr(self_exe_path), &args); |
src/libc_installation.cpp+4-2| ... | @@ -153,6 +153,7 @@ static Error zig_libc_find_native_include_dir_posix(ZigLibCInstallation *self, b | ... | @@ -153,6 +153,7 @@ static Error zig_libc_find_native_include_dir_posix(ZigLibCInstallation *self, b |
| 153 | const char *cc_exe = getenv("CC"); | 153 | const char *cc_exe = getenv("CC"); |
| 154 | cc_exe = (cc_exe == nullptr) ? CC_EXE : cc_exe; | 154 | cc_exe = (cc_exe == nullptr) ? CC_EXE : cc_exe; |
| 155 | ZigList<const char *> args = {}; | 155 | ZigList<const char *> args = {}; |
| 156 | args.append(cc_exe); | ||
| 156 | args.append("-E"); | 157 | args.append("-E"); |
| 157 | args.append("-Wp,-v"); | 158 | args.append("-Wp,-v"); |
| 158 | args.append("-xc"); | 159 | args.append("-xc"); |
| ... | @@ -166,7 +167,7 @@ static Error zig_libc_find_native_include_dir_posix(ZigLibCInstallation *self, b | ... | @@ -166,7 +167,7 @@ static Error zig_libc_find_native_include_dir_posix(ZigLibCInstallation *self, b |
| 166 | Buf *out_stderr = buf_alloc(); | 167 | Buf *out_stderr = buf_alloc(); |
| 167 | Buf *out_stdout = buf_alloc(); | 168 | Buf *out_stdout = buf_alloc(); |
| 168 | Error err; | 169 | Error err; |
| 169 | if ((err = os_exec_process(cc_exe, args, &term, out_stderr, out_stdout))) { | 170 | if ((err = os_exec_process(args, &term, out_stderr, out_stdout))) { |
| 170 | if (verbose) { | 171 | if (verbose) { |
| 171 | fprintf(stderr, "unable to determine libc include path: executing '%s': %s\n", cc_exe, err_str(err)); | 172 | fprintf(stderr, "unable to determine libc include path: executing '%s': %s\n", cc_exe, err_str(err)); |
| 172 | } | 173 | } |
| ... | @@ -277,12 +278,13 @@ Error zig_libc_cc_print_file_name(const char *o_file, Buf *out, bool want_dirnam | ... | @@ -277,12 +278,13 @@ Error zig_libc_cc_print_file_name(const char *o_file, Buf *out, bool want_dirnam |
| 277 | const char *cc_exe = getenv("CC"); | 278 | const char *cc_exe = getenv("CC"); |
| 278 | cc_exe = (cc_exe == nullptr) ? CC_EXE : cc_exe; | 279 | cc_exe = (cc_exe == nullptr) ? CC_EXE : cc_exe; |
| 279 | ZigList<const char *> args = {}; | 280 | ZigList<const char *> args = {}; |
| 281 | args.append(cc_exe); | ||
| 280 | args.append(buf_ptr(buf_sprintf("-print-file-name=%s", o_file))); | 282 | args.append(buf_ptr(buf_sprintf("-print-file-name=%s", o_file))); |
| 281 | Termination term; | 283 | Termination term; |
| 282 | Buf *out_stderr = buf_alloc(); | 284 | Buf *out_stderr = buf_alloc(); |
| 283 | Buf *out_stdout = buf_alloc(); | 285 | Buf *out_stdout = buf_alloc(); |
| 284 | Error err; | 286 | Error err; |
| 285 | if ((err = os_exec_process(cc_exe, args, &term, out_stderr, out_stdout))) { | 287 | if ((err = os_exec_process(args, &term, out_stderr, out_stdout))) { |
| 286 | if (err == ErrorFileNotFound) | 288 | if (err == ErrorFileNotFound) |
| 287 | return ErrorNoCCompilerInstalled; | 289 | return ErrorNoCCompilerInstalled; |
| 288 | if (verbose) { | 290 | if (verbose) { |
src/link.cpp+2-1| ... | @@ -1721,10 +1721,11 @@ void codegen_link(CodeGen *g) { | ... | @@ -1721,10 +1721,11 @@ void codegen_link(CodeGen *g) { |
| 1721 | if (g->system_linker_hack && g->zig_target->os == OsMacOSX) { | 1721 | if (g->system_linker_hack && g->zig_target->os == OsMacOSX) { |
| 1722 | Termination term; | 1722 | Termination term; |
| 1723 | ZigList<const char *> args = {}; | 1723 | ZigList<const char *> args = {}; |
| 1724 | args.append("ld"); | ||
| 1724 | for (size_t i = 1; i < lj.args.length; i += 1) { | 1725 | for (size_t i = 1; i < lj.args.length; i += 1) { |
| 1725 | args.append(lj.args.at(i)); | 1726 | args.append(lj.args.at(i)); |
| 1726 | } | 1727 | } |
| 1727 | os_spawn_process("ld", args, &term); | 1728 | os_spawn_process(args, &term); |
| 1728 | if (term.how != TerminationIdClean || term.code != 0) { | 1729 | if (term.how != TerminationIdClean || term.code != 0) { |
| 1729 | exit(1); | 1730 | exit(1); |
| 1730 | } | 1731 | } |
src/main.cpp+12-16| ... | @@ -467,6 +467,7 @@ int main(int argc, char **argv) { | ... | @@ -467,6 +467,7 @@ int main(int argc, char **argv) { |
| 467 | init_all_targets(); | 467 | init_all_targets(); |
| 468 | 468 | ||
| 469 | ZigList<const char *> args = {0}; | 469 | ZigList<const char *> args = {0}; |
| 470 | args.append(NULL); // placeholder | ||
| 470 | args.append(zig_exe_path); | 471 | args.append(zig_exe_path); |
| 471 | args.append(NULL); // placeholder | 472 | args.append(NULL); // placeholder |
| 472 | args.append(NULL); // placeholder | 473 | args.append(NULL); // placeholder |
| ... | @@ -525,8 +526,8 @@ int main(int argc, char **argv) { | ... | @@ -525,8 +526,8 @@ int main(int argc, char **argv) { |
| 525 | g->enable_time_report = timing_info; | 526 | g->enable_time_report = timing_info; |
| 526 | codegen_set_out_name(g, buf_create_from_str("build")); | 527 | codegen_set_out_name(g, buf_create_from_str("build")); |
| 527 | 528 | ||
| 528 | args.items[1] = buf_ptr(&build_file_dirname); | 529 | args.items[2] = buf_ptr(&build_file_dirname); |
| 529 | args.items[2] = buf_ptr(&full_cache_dir); | 530 | args.items[3] = buf_ptr(&full_cache_dir); |
| 530 | 531 | ||
| 531 | bool build_file_exists; | 532 | bool build_file_exists; |
| 532 | if ((err = os_file_exists(&build_file_abs, &build_file_exists))) { | 533 | if ((err = os_file_exists(&build_file_abs, &build_file_exists))) { |
| ... | @@ -580,12 +581,14 @@ int main(int argc, char **argv) { | ... | @@ -580,12 +581,14 @@ int main(int argc, char **argv) { |
| 580 | codegen_build_and_link(g); | 581 | codegen_build_and_link(g); |
| 581 | 582 | ||
| 582 | Termination term; | 583 | Termination term; |
| 583 | os_spawn_process(buf_ptr(&g->output_file_path), args, &term); | 584 | args.items[0] = buf_ptr(&g->output_file_path); |
| 585 | os_spawn_process(args, &term); | ||
| 584 | if (term.how != TerminationIdClean || term.code != 0) { | 586 | if (term.how != TerminationIdClean || term.code != 0) { |
| 585 | fprintf(stderr, "\nBuild failed. The following command failed:\n"); | 587 | fprintf(stderr, "\nBuild failed. The following command failed:\n"); |
| 586 | fprintf(stderr, "%s", buf_ptr(&g->output_file_path)); | 588 | const char *prefix = ""; |
| 587 | for (size_t i = 0; i < args.length; i += 1) { | 589 | for (size_t i = 0; i < args.length; i += 1) { |
| 588 | fprintf(stderr, " %s", args.at(i)); | 590 | fprintf(stderr, "%s%s", prefix, args.at(i)); |
| 591 | prefix = " "; | ||
| 589 | } | 592 | } |
| 590 | fprintf(stderr, "\n"); | 593 | fprintf(stderr, "\n"); |
| 591 | } | 594 | } |
| ... | @@ -1161,7 +1164,7 @@ int main(int argc, char **argv) { | ... | @@ -1161,7 +1164,7 @@ int main(int argc, char **argv) { |
| 1161 | 1164 | ||
| 1162 | args.pop(); | 1165 | args.pop(); |
| 1163 | Termination term; | 1166 | Termination term; |
| 1164 | os_spawn_process(exec_path, args, &term); | 1167 | os_spawn_process(args, &term); |
| 1165 | return term.code; | 1168 | return term.code; |
| 1166 | } else if (cmd == CmdBuild) { | 1169 | } else if (cmd == CmdBuild) { |
| 1167 | if (g->enable_cache) { | 1170 | if (g->enable_cache) { |
| ... | @@ -1213,17 +1216,10 @@ int main(int argc, char **argv) { | ... | @@ -1213,17 +1216,10 @@ int main(int argc, char **argv) { |
| 1213 | } | 1216 | } |
| 1214 | 1217 | ||
| 1215 | Termination term; | 1218 | Termination term; |
| 1216 | if (test_exec_args.length > 0) { | 1219 | if (test_exec_args.length == 0) { |
| 1217 | ZigList<const char *> rest_args = {0}; | 1220 | test_exec_args.append(buf_ptr(test_exe_path)); |
| 1218 | for (size_t i = 1; i < test_exec_args.length; i += 1) { | ||
| 1219 | rest_args.append(test_exec_args.at(i)); | ||
| 1220 | } | ||
| 1221 | os_spawn_process(test_exec_args.items[0], rest_args, &term); | ||
| 1222 | } else { | ||
| 1223 | ZigList<const char *> no_args = {0}; | ||
| 1224 | os_spawn_process(buf_ptr(test_exe_path), no_args, &term); | ||
| 1225 | } | 1221 | } |
| 1226 | 1222 | os_spawn_process(test_exec_args, &term); | |
| 1227 | if (term.how != TerminationIdClean || term.code != 0) { | 1223 | if (term.how != TerminationIdClean || term.code != 0) { |
| 1228 | fprintf(stderr, "\nTests failed. Use the following command to reproduce the failure:\n"); | 1224 | fprintf(stderr, "\nTests failed. Use the following command to reproduce the failure:\n"); |
| 1229 | fprintf(stderr, "%s\n", buf_ptr(test_exe_path)); | 1225 | fprintf(stderr, "%s\n", buf_ptr(test_exe_path)); |
src/os.cpp+27-29| ... | @@ -105,16 +105,15 @@ static void populate_termination(Termination *term, int status) { | ... | @@ -105,16 +105,15 @@ static void populate_termination(Termination *term, int status) { |
| 105 | } | 105 | } |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | static void os_spawn_process_posix(const char *exe, ZigList<const char *> &args, Termination *term) { | 108 | static void os_spawn_process_posix(ZigList<const char *> &args, Termination *term) { |
| 109 | const char **argv = allocate<const char *>(args.length + 2); | 109 | const char **argv = allocate<const char *>(args.length + 1); |
| 110 | argv[0] = exe; | ||
| 111 | argv[args.length + 1] = nullptr; | ||
| 112 | for (size_t i = 0; i < args.length; i += 1) { | 110 | for (size_t i = 0; i < args.length; i += 1) { |
| 113 | argv[i + 1] = args.at(i); | 111 | argv[i] = args.at(i); |
| 114 | } | 112 | } |
| 113 | argv[args.length] = nullptr; | ||
| 115 | 114 | ||
| 116 | pid_t pid; | 115 | pid_t pid; |
| 117 | int rc = posix_spawnp(&pid, exe, nullptr, nullptr, const_cast<char *const*>(argv), environ); | 116 | int rc = posix_spawnp(&pid, args.at(0), nullptr, nullptr, const_cast<char *const*>(argv), environ); |
| 118 | if (rc != 0) { | 117 | if (rc != 0) { |
| 119 | zig_panic("posix_spawn failed: %s", strerror(rc)); | 118 | zig_panic("posix_spawn failed: %s", strerror(rc)); |
| 120 | } | 119 | } |
| ... | @@ -126,16 +125,14 @@ static void os_spawn_process_posix(const char *exe, ZigList<const char *> &args, | ... | @@ -126,16 +125,14 @@ static void os_spawn_process_posix(const char *exe, ZigList<const char *> &args, |
| 126 | #endif | 125 | #endif |
| 127 | 126 | ||
| 128 | #if defined(ZIG_OS_WINDOWS) | 127 | #if defined(ZIG_OS_WINDOWS) |
| 129 | static void os_windows_create_command_line(Buf *command_line, const char *exe, ZigList<const char *> &args) { | ||
| 130 | buf_resize(command_line, 0); | ||
| 131 | |||
| 132 | buf_append_char(command_line, '\"'); | ||
| 133 | buf_append_str(command_line, exe); | ||
| 134 | buf_append_char(command_line, '\"'); | ||
| 135 | 128 | ||
| 129 | static void os_windows_create_command_line(Buf *command_line, ZigList<const char *> &args) { | ||
| 130 | buf_resize(command_line, 0); | ||
| 131 | char *prefix = "\""; | ||
| 136 | for (size_t arg_i = 0; arg_i < args.length; arg_i += 1) { | 132 | for (size_t arg_i = 0; arg_i < args.length; arg_i += 1) { |
| 137 | buf_append_str(command_line, " \""); | ||
| 138 | const char *arg = args.at(arg_i); | 133 | const char *arg = args.at(arg_i); |
| 134 | buf_append_str(command_line, prefix); | ||
| 135 | prefix = " \""; | ||
| 139 | size_t arg_len = strlen(arg); | 136 | size_t arg_len = strlen(arg); |
| 140 | for (size_t c_i = 0; c_i < arg_len; c_i += 1) { | 137 | for (size_t c_i = 0; c_i < arg_len; c_i += 1) { |
| 141 | if (arg[c_i] == '\"') { | 138 | if (arg[c_i] == '\"') { |
| ... | @@ -147,14 +144,15 @@ static void os_windows_create_command_line(Buf *command_line, const char *exe, Z | ... | @@ -147,14 +144,15 @@ static void os_windows_create_command_line(Buf *command_line, const char *exe, Z |
| 147 | } | 144 | } |
| 148 | } | 145 | } |
| 149 | 146 | ||
| 150 | static void os_spawn_process_windows(const char *exe, ZigList<const char *> &args, Termination *term) { | 147 | static void os_spawn_process_windows(ZigList<const char *> &args, Termination *term) { |
| 151 | Buf command_line = BUF_INIT; | 148 | Buf command_line = BUF_INIT; |
| 152 | os_windows_create_command_line(&command_line, exe, args); | 149 | os_windows_create_command_line(&command_line, args); |
| 153 | 150 | ||
| 154 | PROCESS_INFORMATION piProcInfo = {0}; | 151 | PROCESS_INFORMATION piProcInfo = {0}; |
| 155 | STARTUPINFO siStartInfo = {0}; | 152 | STARTUPINFO siStartInfo = {0}; |
| 156 | siStartInfo.cb = sizeof(STARTUPINFO); | 153 | siStartInfo.cb = sizeof(STARTUPINFO); |
| 157 | 154 | ||
| 155 | const char *exe = args.at(0); | ||
| 158 | BOOL success = CreateProcessA(exe, buf_ptr(&command_line), nullptr, nullptr, TRUE, 0, nullptr, nullptr, | 156 | BOOL success = CreateProcessA(exe, buf_ptr(&command_line), nullptr, nullptr, TRUE, 0, nullptr, nullptr, |
| 159 | &siStartInfo, &piProcInfo); | 157 | &siStartInfo, &piProcInfo); |
| 160 | 158 | ||
| ... | @@ -173,11 +171,11 @@ static void os_spawn_process_windows(const char *exe, ZigList<const char *> &arg | ... | @@ -173,11 +171,11 @@ static void os_spawn_process_windows(const char *exe, ZigList<const char *> &arg |
| 173 | } | 171 | } |
| 174 | #endif | 172 | #endif |
| 175 | 173 | ||
| 176 | void os_spawn_process(const char *exe, ZigList<const char *> &args, Termination *term) { | 174 | void os_spawn_process(ZigList<const char *> &args, Termination *term) { |
| 177 | #if defined(ZIG_OS_WINDOWS) | 175 | #if defined(ZIG_OS_WINDOWS) |
| 178 | os_spawn_process_windows(exe, args, term); | 176 | os_spawn_process_windows(args, term); |
| 179 | #elif defined(ZIG_OS_POSIX) | 177 | #elif defined(ZIG_OS_POSIX) |
| 180 | os_spawn_process_posix(exe, args, term); | 178 | os_spawn_process_posix(args, term); |
| 181 | #else | 179 | #else |
| 182 | #error "missing os_spawn_process implementation" | 180 | #error "missing os_spawn_process implementation" |
| 183 | #endif | 181 | #endif |
| ... | @@ -785,7 +783,7 @@ Error os_file_exists(Buf *full_path, bool *result) { | ... | @@ -785,7 +783,7 @@ Error os_file_exists(Buf *full_path, bool *result) { |
| 785 | } | 783 | } |
| 786 | 784 | ||
| 787 | #if defined(ZIG_OS_POSIX) | 785 | #if defined(ZIG_OS_POSIX) |
| 788 | static Error os_exec_process_posix(const char *exe, ZigList<const char *> &args, | 786 | static Error os_exec_process_posix(ZigList<const char *> &args, |
| 789 | Termination *term, Buf *out_stderr, Buf *out_stdout) | 787 | Termination *term, Buf *out_stderr, Buf *out_stdout) |
| 790 | { | 788 | { |
| 791 | int stdin_pipe[2]; | 789 | int stdin_pipe[2]; |
| ... | @@ -817,13 +815,12 @@ static Error os_exec_process_posix(const char *exe, ZigList<const char *> &args, | ... | @@ -817,13 +815,12 @@ static Error os_exec_process_posix(const char *exe, ZigList<const char *> &args, |
| 817 | if (dup2(stderr_pipe[1], STDERR_FILENO) == -1) | 815 | if (dup2(stderr_pipe[1], STDERR_FILENO) == -1) |
| 818 | zig_panic("dup2 failed"); | 816 | zig_panic("dup2 failed"); |
| 819 | 817 | ||
| 820 | const char **argv = allocate<const char *>(args.length + 2); | 818 | const char **argv = allocate<const char *>(args.length + 1); |
| 821 | argv[0] = exe; | 819 | argv[args.length] = nullptr; |
| 822 | argv[args.length + 1] = nullptr; | ||
| 823 | for (size_t i = 0; i < args.length; i += 1) { | 820 | for (size_t i = 0; i < args.length; i += 1) { |
| 824 | argv[i + 1] = args.at(i); | 821 | argv[i] = args.at(i); |
| 825 | } | 822 | } |
| 826 | execvp(exe, const_cast<char * const *>(argv)); | 823 | execvp(argv[0], const_cast<char * const *>(argv)); |
| 827 | Error report_err = ErrorUnexpected; | 824 | Error report_err = ErrorUnexpected; |
| 828 | if (errno == ENOENT) { | 825 | if (errno == ENOENT) { |
| 829 | report_err = ErrorFileNotFound; | 826 | report_err = ErrorFileNotFound; |
| ... | @@ -874,11 +871,11 @@ static Error os_exec_process_posix(const char *exe, ZigList<const char *> &args, | ... | @@ -874,11 +871,11 @@ static Error os_exec_process_posix(const char *exe, ZigList<const char *> &args, |
| 874 | // LocalFree(messageBuffer); | 871 | // LocalFree(messageBuffer); |
| 875 | //} | 872 | //} |
| 876 | 873 | ||
| 877 | static Error os_exec_process_windows(const char *exe, ZigList<const char *> &args, | 874 | static Error os_exec_process_windows(ZigList<const char *> &args, |
| 878 | Termination *term, Buf *out_stderr, Buf *out_stdout) | 875 | Termination *term, Buf *out_stderr, Buf *out_stdout) |
| 879 | { | 876 | { |
| 880 | Buf command_line = BUF_INIT; | 877 | Buf command_line = BUF_INIT; |
| 881 | os_windows_create_command_line(&command_line, exe, args); | 878 | os_windows_create_command_line(&command_line, args); |
| 882 | 879 | ||
| 883 | HANDLE g_hChildStd_IN_Rd = NULL; | 880 | HANDLE g_hChildStd_IN_Rd = NULL; |
| 884 | HANDLE g_hChildStd_IN_Wr = NULL; | 881 | HANDLE g_hChildStd_IN_Wr = NULL; |
| ... | @@ -925,6 +922,7 @@ static Error os_exec_process_windows(const char *exe, ZigList<const char *> &arg | ... | @@ -925,6 +922,7 @@ static Error os_exec_process_windows(const char *exe, ZigList<const char *> &arg |
| 925 | siStartInfo.hStdInput = g_hChildStd_IN_Rd; | 922 | siStartInfo.hStdInput = g_hChildStd_IN_Rd; |
| 926 | siStartInfo.dwFlags |= STARTF_USESTDHANDLES; | 923 | siStartInfo.dwFlags |= STARTF_USESTDHANDLES; |
| 927 | 924 | ||
| 925 | const char *exe = args.at(0); | ||
| 928 | BOOL success = CreateProcess(exe, buf_ptr(&command_line), nullptr, nullptr, TRUE, 0, nullptr, nullptr, | 926 | BOOL success = CreateProcess(exe, buf_ptr(&command_line), nullptr, nullptr, TRUE, 0, nullptr, nullptr, |
| 929 | &siStartInfo, &piProcInfo); | 927 | &siStartInfo, &piProcInfo); |
| 930 | 928 | ||
| ... | @@ -1005,13 +1003,13 @@ Error os_execv(const char *exe, const char **argv) { | ... | @@ -1005,13 +1003,13 @@ Error os_execv(const char *exe, const char **argv) { |
| 1005 | #endif | 1003 | #endif |
| 1006 | } | 1004 | } |
| 1007 | 1005 | ||
| 1008 | Error os_exec_process(const char *exe, ZigList<const char *> &args, | 1006 | Error os_exec_process(ZigList<const char *> &args, |
| 1009 | Termination *term, Buf *out_stderr, Buf *out_stdout) | 1007 | Termination *term, Buf *out_stderr, Buf *out_stdout) |
| 1010 | { | 1008 | { |
| 1011 | #if defined(ZIG_OS_WINDOWS) | 1009 | #if defined(ZIG_OS_WINDOWS) |
| 1012 | return os_exec_process_windows(exe, args, term, out_stderr, out_stdout); | 1010 | return os_exec_process_windows(args, term, out_stderr, out_stdout); |
| 1013 | #elif defined(ZIG_OS_POSIX) | 1011 | #elif defined(ZIG_OS_POSIX) |
| 1014 | return os_exec_process_posix(exe, args, term, out_stderr, out_stdout); | 1012 | return os_exec_process_posix(args, term, out_stderr, out_stdout); |
| 1015 | #else | 1013 | #else |
| 1016 | #error "missing os_exec_process implementation" | 1014 | #error "missing os_exec_process implementation" |
| 1017 | #endif | 1015 | #endif |
src/os.hpp+2-2| ... | @@ -100,8 +100,8 @@ struct OsFileAttr { | ... | @@ -100,8 +100,8 @@ struct OsFileAttr { |
| 100 | 100 | ||
| 101 | int os_init(void); | 101 | int os_init(void); |
| 102 | 102 | ||
| 103 | void os_spawn_process(const char *exe, ZigList<const char *> &args, Termination *term); | 103 | void os_spawn_process(ZigList<const char *> &args, Termination *term); |
| 104 | Error os_exec_process(const char *exe, ZigList<const char *> &args, | 104 | Error os_exec_process(ZigList<const char *> &args, |
| 105 | Termination *term, Buf *out_stderr, Buf *out_stdout); | 105 | Termination *term, Buf *out_stderr, Buf *out_stdout); |
| 106 | Error os_execv(const char *exe, const char **argv); | 106 | Error os_execv(const char *exe, const char **argv); |
| 107 | 107 |