From 2d12f0d174ec63106704c9aa715e6748328a79c2 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Tue, 18 Oct 2022 11:00:15 -0400 Subject: [PATCH] viso: use custom POSIX dir implementation on windows, otherwise use dir.h --- src/include/86box/plat_dir.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/include/86box/plat_dir.h b/src/include/86box/plat_dir.h index 73c33eebf..7a7876ebb 100644 --- a/src/include/86box/plat_dir.h +++ b/src/include/86box/plat_dir.h @@ -17,6 +17,8 @@ #ifndef PLAT_DIR_H #define PLAT_DIR_H +/* Windows needs the POSIX re-implementations */ +#if defined(_WIN32) #ifdef _MAX_FNAME # define MAXNAMLEN _MAX_FNAME #else @@ -63,5 +65,10 @@ extern void seekdir(DIR *, long); extern int closedir(DIR *); #define rewinddir(dirp) seekdir(dirp, 0L) +#else +/* On linux and macOS, use the standard functions and types */ +#include +#endif + #endif /*PLAT_DIR_H*/