diff --git a/libretro-common/compat/fopen_utf8.c b/libretro-common/compat/fopen_utf8.c index 4893a341a6..52b481e7e7 100644 --- a/libretro-common/compat/fopen_utf8.c +++ b/libretro-common/compat/fopen_utf8.c @@ -31,10 +31,11 @@ #endif #endif +#ifdef _WIN32 +#undef fopen + void *fopen_utf8(const char * filename, const char * mode) { -#if defined(_WIN32) -#undef fopen #if defined(_XBOX) return fopen(filename, mode); #elif defined(LEGACY_WIN32) @@ -55,7 +56,5 @@ void *fopen_utf8(const char * filename, const char * mode) free(mode_w); return ret; #endif -#else - return fopen(filename, mode); -#endif } +#endif diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index f56ab673a1..6db4f005e8 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -219,7 +219,7 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #endif case IS_CHARACTER_SPECIAL: #if defined(VITA) || defined(PSP) || defined(PS2) || defined(__CELLOS_LV2__) || defined(_WIN32) - break; + return false; #else return S_ISCHR(buf.st_mode); #endif diff --git a/libretro-common/include/compat/fopen_utf8.h b/libretro-common/include/compat/fopen_utf8.h index a9a373e66d..f59822a5ca 100644 --- a/libretro-common/include/compat/fopen_utf8.h +++ b/libretro-common/include/compat/fopen_utf8.h @@ -23,12 +23,12 @@ #ifndef __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H #define __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H -/* Defined to error rather than fopen_utf8, to make it - * clear to everyone reading the code that not worrying - * about UTF16 is fine. */ - +#ifdef _WIN32 +/* Defined to error rather than fopen_utf8, to make it clear to everyone reading the code that not worrying about utf16 is fine */ /* TODO: enable */ /* #define fopen (use fopen_utf8 instead) */ void *fopen_utf8(const char * filename, const char * mode); - +#else +#define fopen_utf8 fopen +#endif #endif