Skip to content

Commit

Permalink
attempt at fixing Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed Sep 15, 2024
1 parent a3d6961 commit 7ac2eb2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/debug/GdbProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ ReadResult GdbStub::MsgRecv()
Log(LogLevel::Debug, "[GDB] receiving from stream %d\n", receivedNum);
#else
// fuck windows
ssize_t receivedNum = recv(ConnFd, (char*)&RecvBuffer[RecvBufferFilled], sizeof(PacketBuf) - RecvBufferFilled, flag);
ssize_t receivedNum = recv(ConnFd, (char*)&RecvBuffer[RecvBufferFilled], sizeof(RecvBuffer) - RecvBufferFilled, flag);
#endif
#endif

Expand Down Expand Up @@ -255,18 +255,18 @@ int GdbStub::WaitAckBlocking(u8* ackp, int to_ms)
#ifdef _WIN32
fd_set infd, outfd, errfd;
FD_ZERO(&infd); FD_ZERO(&outfd); FD_ZERO(&errfd);
FD_SET(connfd, &infd);
FD_SET(ConnFd, &infd);

struct timeval to;
to.tv_sec = to_ms / 1000;
to.tv_usec = (to_ms % 1000) * 1000;

int r = select(connfd+1, &infd, &outfd, &errfd, &to);
int r = select(ConnFd+1, &infd, &outfd, &errfd, &to);

if (FD_ISSET(connfd, &errfd)) return -1;
else if (FD_ISSET(connfd, &infd))
if (FD_ISSET(ConnFd, &errfd)) return -1;
else if (FD_ISSET(ConnFd, &infd))
{
r = recv(connfd, (char*)ackp, 1, 0);
r = recv(ConnFd, (char*)ackp, 1, 0);
if (r < 0) return r;
return 0;
}
Expand Down

0 comments on commit 7ac2eb2

Please sign in to comment.