SimRsim.c: EMSCRIPTEN fix for select/fd_set

The compiler has started to error on casting int* to fd_set*
Since WASM build has presense of fd_set then the ifdef have been
switched away from the legacy (pre 2000) method.
This commit is contained in:
Darryl L. Miles 2025-10-03 23:25:45 +01:00 committed by R. Timothy Edwards
parent 3c9987f460
commit 2259ef626d
1 changed files with 4 additions and 4 deletions

View File

@ -629,7 +629,7 @@ SimFillBuffer(
int charsRead = 0; int charsRead = 0;
char *temp; char *temp;
int n, nfd; int n, nfd;
#if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) #if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) || defined(EMSCRIPTEN)
fd_set readfds, writefds, exceptfds; fd_set readfds, writefds, exceptfds;
#else #else
int nr, nex; int nr, nex;
@ -645,7 +645,7 @@ SimFillBuffer(
/* read reply from Rsim */ /* read reply from Rsim */
#if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) #if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) || defined(EMSCRIPTEN)
FD_ZERO(&readfds); FD_ZERO(&readfds);
FD_ZERO(&exceptfds); FD_ZERO(&exceptfds);
#endif /* SYSV */ #endif /* SYSV */
@ -661,7 +661,7 @@ SimFillBuffer(
try_again: try_again:
#if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) #if defined(SYSV) || defined(CYGWIN) || defined(__FreeBSD__) || defined(__APPLE__) || defined(EMSCRIPTEN)
FD_SET(pipeIn, &readfds); FD_SET(pipeIn, &readfds);
FD_ZERO(&writefds); FD_ZERO(&writefds);
FD_SET(pipeIn, &exceptfds); FD_SET(pipeIn, &exceptfds);
@ -669,7 +669,7 @@ try_again:
#else /* !SYSV */ #else /* !SYSV */
nr = nex = 1 << pipeIn; nr = nex = 1 << pipeIn;
n = select(nfd, &nr, (int *) NULL, &nex, &timeout); n = select(nfd, &nr, NULL, &nex, &timeout);
#endif #endif