diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c index b750f43c66..338200cc0d 100644 --- a/frontend/drivers/platform_unix.c +++ b/frontend/drivers/platform_unix.c @@ -2372,8 +2372,15 @@ static bool frontend_unix_check_for_path_changes(path_change_data_t *change_data { unsigned j; - /* A successful close does not guarantee that the data has been successfully saved to disk, as the kernel defers writes. It is not common for a file system to flush the buffers when the stream is closed. - * So we manually fsync() here to flush the data to disk, to make sure that the new data is immediately available when the file is re-read. + /* A successful close does not guarantee that the + * data has been successfully saved to disk, + * as the kernel defers writes. It is + * not common for a file system to flush + * the buffers when the stream is closed. + * + * So we manually fsync() here to flush the data + * to disk, to make sure that the new data is + * immediately available when the file is re-read. */ for (j = 0; j < inotify_data->wd_list->count; j++) { @@ -2381,7 +2388,7 @@ static bool frontend_unix_check_for_path_changes(path_change_data_t *change_data { /* found the right file, now sync it */ const char *path = inotify_data->path_list->elems[j].data; - FILE *fp = fopen_utf8(path, "rb"); + FILE *fp = (FILE*)fopen_utf8(path, "rb"); RARCH_LOG("file change detected: %s\n", path); diff --git a/libretro-common/compat/compat_snprintf.c b/libretro-common/compat/compat_snprintf.c index 03bfba64da..f31de72d8c 100644 --- a/libretro-common/compat/compat_snprintf.c +++ b/libretro-common/compat/compat_snprintf.c @@ -25,7 +25,6 @@ #include -#include #include #if _MSC_VER < 1800 diff --git a/libretro-common/compat/fopen_utf8.c b/libretro-common/compat/fopen_utf8.c index abd50cf275..d9fe35fec6 100644 --- a/libretro-common/compat/fopen_utf8.c +++ b/libretro-common/compat/fopen_utf8.c @@ -1,5 +1,6 @@ #include #include +#include #include #if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0500 || defined(_XBOX) @@ -11,7 +12,7 @@ #ifdef _WIN32 #undef fopen -FILE* fopen_utf8(const char * filename, const char * mode) +void *fopen_utf8(const char * filename, const char * mode) { #if defined(_XBOX) return fopen(filename, mode); diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 455d3aa513..50bdfd8e30 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -862,7 +862,7 @@ bool config_file_write(config_file_t *conf, const char *path) if (!string_is_empty(path)) { void* buf = NULL; - FILE *file = fopen_utf8(path, "wb"); + FILE *file = (FILE*)fopen_utf8(path, "wb"); if (!file) return false; diff --git a/libretro-common/include/compat/fopen_utf8.h b/libretro-common/include/compat/fopen_utf8.h index 67cc289aa6..1fe6a8aab6 100644 --- a/libretro-common/include/compat/fopen_utf8.h +++ b/libretro-common/include/compat/fopen_utf8.h @@ -1,13 +1,11 @@ #ifndef __FOPEN_UTF8_H #define __FOPEN_UTF8_H -#include - #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) */ -FILE* fopen_utf8(const char * filename, const char * mode); +void *fopen_utf8(const char * filename, const char * mode); #else #define fopen_utf8 fopen #endif diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index 95fbbf1d8d..ce6fa5bf0e 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -264,7 +264,7 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(const char *path, uns if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) { - FILE *fp = fopen_utf8(path, mode_str); + FILE *fp = (FILE*)fopen_utf8(path, mode_str); if (!fp) goto error; diff --git a/verbosity.c b/verbosity.c index 4f3548af97..ddb46512a9 100644 --- a/verbosity.c +++ b/verbosity.c @@ -101,7 +101,7 @@ void retro_main_log_file_init(const char *path) if (path == NULL) return; - log_file_fp = fopen_utf8(path, "wb"); + log_file_fp = (FILE*)fopen_utf8(path, "wb"); log_file_initialized = true; /* TODO: this is only useful for a few platforms, find which and add ifdef */