diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index ee30c29902..277073b7dc 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -59,25 +59,6 @@ #include #include -struct RDIR -{ -#if defined(_WIN32) - WIN32_FIND_DATA entry; - HANDLE directory; - bool next; -#elif defined(VITA) || defined(PSP) - SceUID directory; - SceIoDirent entry; -#elif defined(__CELLOS_LV2__) - CellFsErrno error; - int directory; - CellFsDirent entry; -#else - DIR *directory; - const struct dirent *entry; -#endif -}; - struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) diff --git a/libretro-common/include/retro_dirent.h b/libretro-common/include/retro_dirent.h index 9b4f53b1d2..1dc6fb2bd1 100644 --- a/libretro-common/include/retro_dirent.h +++ b/libretro-common/include/retro_dirent.h @@ -29,7 +29,24 @@ RETRO_BEGIN_DECLS -struct RDIR; +struct RDIR +{ +#if defined(_WIN32) + WIN32_FIND_DATA entry; + HANDLE directory; + bool next; +#elif defined(VITA) || defined(PSP) + SceUID directory; + SceIoDirent entry; +#elif defined(__CELLOS_LV2__) + CellFsErrno error; + int directory; + CellFsDirent entry; +#else + DIR *directory; + const struct dirent *entry; +#endif +}; struct RDIR *retro_opendir(const char *name); diff --git a/libretro-common/lists/dir_list.c b/libretro-common/lists/dir_list.c index 2b71a6381c..c61eb1a449 100644 --- a/libretro-common/lists/dir_list.c +++ b/libretro-common/lists/dir_list.c @@ -22,6 +22,10 @@ #include +#ifdef _WIN32 +#include +#endif + #include #include #include @@ -211,9 +215,9 @@ int dir_list_read(const char *dir, struct string_list *list, struct string_list #ifdef _WIN32 if (include_hidden) - entry.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; + entry->entry.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; else - entry.dwFileAttributes &= ~FILE_ATTRIBUTE_HIDDEN; + entry->entry.dwFileAttributes &= ~FILE_ATTRIBUTE_HIDDEN; #endif while (retro_readdir(entry))