Skip to content

Commit

Permalink
(engine) select() is not available in mingw64, dummy version of $inpu…
Browse files Browse the repository at this point in the history
…t_wait

Src-commit: a980b82641f0405a3dd1886803d372760d6297a4
  • Loading branch information
jfmc committed Jul 22, 2024
1 parent d45e977 commit 4c922d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: msys2/setup-msys2@v2
if: (matrix.sys.os == 'windows-2019')
with:
msystem: ${{ fromJSON('["MINGW32", "MINGW64"]')[matrix.sys.arch != 'i686'] }}
msystem: ${{ fromJSON('["mingw32", "mingw64"]')[matrix.sys.arch != 'i686'] }}
update: true
install: git base-devel
- run: |
Expand Down
10 changes: 9 additions & 1 deletion core/engine/io_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#include <stdlib.h> /* for atoi MCL */
#include <string.h>
#include <strings.h>
#if defined(_WIN32) || defined(_WIN64) /* MinGW */
#else
#include <sys/select.h> /* select() */
#endif

#include <ciao/eng.h>
#include <ciao/eng_registry.h>
Expand Down Expand Up @@ -1776,6 +1779,10 @@ CBOOL__PROTO(prolog_set_unbuf) {

CBOOL__PROTO(prolog_input_wait) {
ERR__FUNCTOR("io_basic:$input_wait", 3);
#if defined(_WIN32) || defined(_WIN64) /* MinGW */
#warning "io_basic:$input_wait is not supported in the Win32 build" /* TODO:[JF] fixme */
CBOOL__PROCEED;
#else
int errcode;
stream_node_t *s = stream_to_ptr_check(X(0), 'r', &errcode);
if (!s) {
Expand All @@ -1785,7 +1792,7 @@ CBOOL__PROTO(prolog_input_wait) {
int fd = fileno(s->streamfile);

if (s->pending_rune != RUNE_VOID) { /* RUNE_EOF or valid rune */
return TRUE;
CBOOL__PROCEED;
}

fd_set set;
Expand All @@ -1807,6 +1814,7 @@ CBOOL__PROTO(prolog_input_wait) {
}

CBOOL__LASTTEST(rv != 0);
#endif
}

/* --------------------------------------------------------------------------- */
Expand Down

0 comments on commit 4c922d2

Please sign in to comment.