mirror of
https://github.com/janet-lang/janet
synced 2025-07-04 19:12:55 +00:00
Fix windows build with JANET_NO_NET - #1055
This commit is contained in:
parent
93b469885a
commit
8ee5942481
@ -2212,9 +2212,9 @@ typedef struct {
|
|||||||
JanetReadMode mode;
|
JanetReadMode mode;
|
||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
OVERLAPPED overlapped;
|
OVERLAPPED overlapped;
|
||||||
|
DWORD flags;
|
||||||
#ifdef JANET_NET
|
#ifdef JANET_NET
|
||||||
WSABUF wbuf;
|
WSABUF wbuf;
|
||||||
DWORD flags;
|
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
int fromlen;
|
int fromlen;
|
||||||
#endif
|
#endif
|
||||||
@ -2288,8 +2288,8 @@ JanetAsyncStatus ev_machine_read(JanetListenerState *s, JanetAsyncEvent event) {
|
|||||||
state->overlapped.Offset = (DWORD) state->bytes_read;
|
state->overlapped.Offset = (DWORD) state->bytes_read;
|
||||||
|
|
||||||
status = ReadFile(s->stream->handle, state->chunk_buf, chunk_size, NULL, &state->overlapped);
|
status = ReadFile(s->stream->handle, state->chunk_buf, chunk_size, NULL, &state->overlapped);
|
||||||
if (!status && (ERROR_IO_PENDING != WSAGetLastError())) {
|
if (!status && (ERROR_IO_PENDING != GetLastError())) {
|
||||||
if (WSAGetLastError() == ERROR_BROKEN_PIPE) {
|
if (GetLastError() == ERROR_BROKEN_PIPE) {
|
||||||
if (state->bytes_read) {
|
if (state->bytes_read) {
|
||||||
janet_schedule(s->fiber, janet_wrap_buffer(state->buf));
|
janet_schedule(s->fiber, janet_wrap_buffer(state->buf));
|
||||||
} else {
|
} else {
|
||||||
@ -2441,9 +2441,9 @@ typedef struct {
|
|||||||
void *dest_abst;
|
void *dest_abst;
|
||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
OVERLAPPED overlapped;
|
OVERLAPPED overlapped;
|
||||||
|
DWORD flags;
|
||||||
#ifdef JANET_NET
|
#ifdef JANET_NET
|
||||||
WSABUF wbuf;
|
WSABUF wbuf;
|
||||||
DWORD flags;
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
int flags;
|
int flags;
|
||||||
@ -2528,7 +2528,7 @@ JanetAsyncStatus ev_machine_write(JanetListenerState *s, JanetAsyncEvent event)
|
|||||||
state->overlapped.Offset = (DWORD) 0xFFFFFFFF;
|
state->overlapped.Offset = (DWORD) 0xFFFFFFFF;
|
||||||
state->overlapped.OffsetHigh = (DWORD) 0xFFFFFFFF;
|
state->overlapped.OffsetHigh = (DWORD) 0xFFFFFFFF;
|
||||||
status = WriteFile(s->stream->handle, bytes, len, NULL, &state->overlapped);
|
status = WriteFile(s->stream->handle, bytes, len, NULL, &state->overlapped);
|
||||||
if (!status && (ERROR_IO_PENDING != WSAGetLastError())) {
|
if (!status && (ERROR_IO_PENDING != GetLastError())) {
|
||||||
janet_cancel(s->fiber, janet_ev_lasterr());
|
janet_cancel(s->fiber, janet_ev_lasterr());
|
||||||
return JANET_ASYNC_STATUS_DONE;
|
return JANET_ASYNC_STATUS_DONE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user