Skip to content

Commit

Permalink
Prevent the preprocessor from replacing std{in,out} with macro
Browse files Browse the repository at this point in the history
Trying to build on alpine (which uses musl instead of glibc) would break
as the preprocessor replaces stdin->(stdin) which fails to compile.

After discussion with @ankon he found:
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20130506/173524.html
  • Loading branch information
vmcj committed Jul 29, 2023
1 parent cd7347c commit 14f071e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions judge/runpipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,22 +641,22 @@ struct state_t {
tie(read_end, write_end) = make_pipe();
logmsg(LOG_DEBUG, "setting up pipe #%ld (fd %d) -> proxy (fd %d)", i,
write_end, read_end);
process.stdout = write_end;
process.pstdout = write_end;
process.process_to_proxy = read_end;
set_non_blocking(process.process_to_proxy);

tie(read_end, write_end) = make_pipe();
logmsg(LOG_DEBUG, "setting up pipe proxy (fd %d) -> #%ld (fd %d)",
write_end, j, read_end);
other.proxy_to_process = write_end;
other.stdin = read_end;
other.pstdin = read_end;
} else {
// No proxy: direct communication.
tie(read_end, write_end) = make_pipe();
logmsg(LOG_DEBUG, "setting up pipe #%ld (fd %d) -> #%ld (fd %d)", i,
write_end, j, read_end);
process.stdout = write_end;
other.stdin = read_end;
process.pstdout = write_end;
other.pstdin = read_end;
}
}
}
Expand Down

0 comments on commit 14f071e

Please sign in to comment.