Skip to content

Commit 4c922d2

Browse files
committed
(engine) select() is not available in mingw64, dummy version of $input_wait
Src-commit: a980b82641f0405a3dd1886803d372760d6297a4
1 parent d45e977 commit 4c922d2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- uses: msys2/setup-msys2@v2
4343
if: (matrix.sys.os == 'windows-2019')
4444
with:
45-
msystem: ${{ fromJSON('["MINGW32", "MINGW64"]')[matrix.sys.arch != 'i686'] }}
45+
msystem: ${{ fromJSON('["mingw32", "mingw64"]')[matrix.sys.arch != 'i686'] }}
4646
update: true
4747
install: git base-devel
4848
- run: |

core/engine/io_basic.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
#include <stdlib.h> /* for atoi MCL */
1313
#include <string.h>
1414
#include <strings.h>
15+
#if defined(_WIN32) || defined(_WIN64) /* MinGW */
16+
#else
1517
#include <sys/select.h> /* select() */
18+
#endif
1619

1720
#include <ciao/eng.h>
1821
#include <ciao/eng_registry.h>
@@ -1776,6 +1779,10 @@ CBOOL__PROTO(prolog_set_unbuf) {
17761779

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

17871794
if (s->pending_rune != RUNE_VOID) { /* RUNE_EOF or valid rune */
1788-
return TRUE;
1795+
CBOOL__PROCEED;
17891796
}
17901797

17911798
fd_set set;
@@ -1807,6 +1814,7 @@ CBOOL__PROTO(prolog_input_wait) {
18071814
}
18081815

18091816
CBOOL__LASTTEST(rv != 0);
1817+
#endif
18101818
}
18111819

18121820
/* --------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)