From 3c0c22259c6126bb5e7ea0811f580f78a2bb388d Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 17 Aug 2024 13:33:39 -0700 Subject: [PATCH] ReadDirectoryChangesExW is only supported in recent windows. Also break mingw builds it seems. --- src/core/filewatch.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/filewatch.c b/src/core/filewatch.c index d9c2165f..d1975606 100644 --- a/src/core/filewatch.c +++ b/src/core/filewatch.c @@ -307,15 +307,14 @@ typedef struct { } OverlappedWatch; static void read_dir_changes(OverlappedWatch *ow) { - BOOL result = ReadDirectoryChangesExW(ow->stream->handle, - (FILE_NOTIFY_EXTENDED_INFORMATION *) ow->buf, + BOOL result = ReadDirectoryChangesW(ow->stream->handle, + (FILE_NOTIFY_INFORMATION *) ow->buf, FILE_INFO_PADDING, TRUE, ow->flags, NULL, (OVERLAPPED *) ow, - NULL, - ReadDirectoryNotifyExtendedInformation); + NULL); if (!result) { janet_panicv(janet_ev_lasterr()); } @@ -350,7 +349,7 @@ static void watcher_callback_read(JanetFiber *fiber, JanetAsyncEvent event) { break; 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) { /* Got an event */ @@ -369,7 +368,7 @@ static void watcher_callback_read(JanetFiber *fiber, JanetAsyncEvent event) { /* Next event */ 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 */