diff --git a/include/compat/msvc/dirent.h b/include/compat/msvc/dirent.h index 2d60d9b..0116a88 100644 --- a/include/compat/msvc/dirent.h +++ b/include/compat/msvc/dirent.h @@ -9,6 +9,14 @@ #ifndef DIRENT_H #define DIRENT_H +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wunused-function" +#elif defined(_MSC_VER) +# pragma warning(disable:4505) // error C4505: '_wreaddir': unreferenced local function has been removed +#else +# pragma GCC diagnostic ignored "-Wunused-function" +#endif // _MSC_VER + /* * Include windows.h without Windows Sockets 1.1 to prevent conflicts with * Windows Sockets 2.0. @@ -371,7 +379,7 @@ _wopendir( * Note that on WinRT there's no way to convert relative paths * into absolute paths, so just assume it is an absolute path. */ -#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) +#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) /* WinRT */ n = wcslen (dirname); #else @@ -393,7 +401,7 @@ _wopendir( * Note that on WinRT there's no way to convert relative paths * into absolute paths, so just assume it is an absolute path. */ -#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) +#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) /* WinRT */ wcsncpy_s (dirp->patt, n+1, dirname, n); #else diff --git a/src/file.cpp b/src/file.cpp index 1848ae9..342d10b 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -638,7 +638,7 @@ namespace bx if (NULL == item) { - return false; + break; } if (0 != (item->d_type & DT_DIR) )