Skip to content

Commit 88c24e0

Browse files
committed
fix: WIFEXITED/WEXITSTATUS not available on Windows (use rc directly)
1 parent 16dd919 commit 88c24e0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/cli.cppm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3162,8 +3162,12 @@ int cmd_test(const mcpplibs::cmdline::ParsedArgs& /*parsed*/,
31623162
std::string cmd = std::format("{}'{}'", pathPrefix, exe.string());
31633163
for (auto& a : passthrough) cmd += std::format(" '{}'", a);
31643164
int rc = std::system(cmd.c_str());
3165-
// std::system returns wait status — extract exit code.
3165+
// std::system returns wait status on POSIX, exit code on Windows.
3166+
#if defined(_WIN32)
3167+
int exitCode = rc;
3168+
#else
31663169
int exitCode = WIFEXITED(rc) ? WEXITSTATUS(rc) : 127;
3170+
#endif
31673171

31683172
if (exitCode == 0) {
31693173
std::println("{} ... ok", lu.targetName);

0 commit comments

Comments
 (0)