Skip to content

Commit

Permalink
Adjustments to Windows ifdef logic
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Nov 5, 2024
1 parent 3724487 commit 77d14c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mged/mged.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,8 @@ main(int argc, char *argv[])
saAttr.bInheritHandle = FALSE;
saAttr.lpSecurityDescriptor = NULL;

Tcl_Channel chan;

if (CreatePipe(&handle[0], &handle[1], &saAttr, 0)) {
chan = Tcl_GetStdChannel(TCL_STDOUT);
Tcl_UnregisterChannel(INTERP, chan);
Expand Down Expand Up @@ -1745,7 +1747,7 @@ stdin_input(ClientData clientData, int UNUSED(mask))
#if defined(_WIN32) && !defined(__CYGWIN__)
Tcl_DString ds;
Tcl_DStringInit(&ds);
count = Tcl_Gets(s->chan, &ds);
count = Tcl_Gets(sd->chan, &ds);

if (count < 0) {
BU_PUT(sd, struct stdio_data);
Expand Down Expand Up @@ -1819,7 +1821,7 @@ stdin_input(ClientData clientData, int UNUSED(mask))
char buf[BU_PAGE_SIZE];
int idx;
# ifdef _WIN32
count = Tcl_Read(chan, buf, BU_PAGE_SIZE);
count = Tcl_Read(sd->chan, buf, BU_PAGE_SIZE);
# else
count = read((int)sd->fd, (void *)buf, BU_PAGE_SIZE);
# endif
Expand Down

0 comments on commit 77d14c8

Please sign in to comment.