mirror of
https://github.com/janet-lang/janet
synced 2024-10-18 16:05:47 +00:00
ReadDirectoryChangesExW is only supported in recent windows.
Also break mingw builds it seems.
This commit is contained in:
parent
42f6af4bf1
commit
3c0c22259c
@ -307,15 +307,14 @@ typedef struct {
|
|||||||
} OverlappedWatch;
|
} OverlappedWatch;
|
||||||
|
|
||||||
static void read_dir_changes(OverlappedWatch *ow) {
|
static void read_dir_changes(OverlappedWatch *ow) {
|
||||||
BOOL result = ReadDirectoryChangesExW(ow->stream->handle,
|
BOOL result = ReadDirectoryChangesW(ow->stream->handle,
|
||||||
(FILE_NOTIFY_EXTENDED_INFORMATION *) ow->buf,
|
(FILE_NOTIFY_INFORMATION *) ow->buf,
|
||||||
FILE_INFO_PADDING,
|
FILE_INFO_PADDING,
|
||||||
TRUE,
|
TRUE,
|
||||||
ow->flags,
|
ow->flags,
|
||||||
NULL,
|
NULL,
|
||||||
(OVERLAPPED *) ow,
|
(OVERLAPPED *) ow,
|
||||||
NULL,
|
NULL);
|
||||||
ReadDirectoryNotifyExtendedInformation);
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
janet_panicv(janet_ev_lasterr());
|
janet_panicv(janet_ev_lasterr());
|
||||||
}
|
}
|
||||||
@ -350,7 +349,7 @@ static void watcher_callback_read(JanetFiber *fiber, JanetAsyncEvent event) {
|
|||||||
break;
|
break;
|
||||||
case JANET_ASYNC_EVENT_COMPLETE:
|
case JANET_ASYNC_EVENT_COMPLETE:
|
||||||
{
|
{
|
||||||
FILE_NOTIFY_EXTENDED_INFORMATION *fni = (FILE_NOTIFY_EXTENDED_INFORMATION *) ow->buf;
|
FILE_NOTIFY_INFORMATION *fni = (FILE_NOTIFY_INFORMATION *) ow->buf;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/* Got an event */
|
/* Got an event */
|
||||||
@ -369,7 +368,7 @@ static void watcher_callback_read(JanetFiber *fiber, JanetAsyncEvent event) {
|
|||||||
|
|
||||||
/* Next event */
|
/* Next event */
|
||||||
if (!fni->NextEntryOffset) break;
|
if (!fni->NextEntryOffset) break;
|
||||||
fni = (FILE_NOTIFY_EXTENDED_INFORMATION *) ((char *)fni + fni->NextEntryOffset);
|
fni = (FILE_NOTIFY_INFORMATION *) ((char *)fni + fni->NextEntryOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make another call to read directory changes */
|
/* Make another call to read directory changes */
|
||||||
|
Loading…
Reference in New Issue
Block a user