diff --git a/libretro-common/compat/fopen_utf8.c b/libretro-common/compat/fopen_utf8.c index 52b481e7e7..4893a341a6 100644 --- a/libretro-common/compat/fopen_utf8.c +++ b/libretro-common/compat/fopen_utf8.c @@ -31,11 +31,10 @@ #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) @@ -56,5 +55,7 @@ void *fopen_utf8(const char * filename, const char * mode) free(mode_w); return ret; #endif -} +#else + return fopen(filename, mode); #endif +} diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 15a1dbae04..b92acfd0e5 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -986,7 +986,7 @@ bool config_file_write(config_file_t *conf, const char *path, bool sort) #ifdef ORBIS int fd = orbisOpen(path,O_RDWR|O_CREAT,0644); RARCH_LOG("[Config]config_file_write orbisOpen path=%s fd=%d\n", path, fd); - if (fd<0) + if (fd < 0) return false; config_file_dump_orbis(conf,fd); orbisClose(fd); diff --git a/libretro-common/include/compat/fopen_utf8.h b/libretro-common/include/compat/fopen_utf8.h index f59822a5ca..a9a373e66d 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 -#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 */ +/* 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 diff --git a/libretro-common/include/file/config_file.h b/libretro-common/include/file/config_file.h index b60801c91b..bf8102f542 100644 --- a/libretro-common/include/file/config_file.h +++ b/libretro-common/include/file/config_file.h @@ -183,13 +183,12 @@ bool config_file_write(config_file_t *conf, const char *path, bool val); /* Dump the current config to an already opened file. * Does not close the file. */ -void config_file_dump(config_file_t *conf, FILE *file); +void config_file_dump(config_file_t *conf, FILE *file, bool val); #ifdef ORBIS void config_file_dump_orbis(config_file_t *conf, int fd); #endif -void config_file_dump(config_file_t *conf, FILE *file, bool val); bool config_file_exists(const char *path); diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index fe1fcded0d..c2232fd6c5 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -325,6 +325,7 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(const char *path, uns #if !defined(PS2) /* TODO: PS2 IMPROVEMENT */ stream->buf = (char*)calloc(1, 0x4000); setvbuf(stream->fp, stream->buf, _IOFBF, 0x4000); +#endif #endif } else