Buildfixes

This commit is contained in:
twinaphex 2019-01-08 20:43:03 +01:00
parent 6bd4d91038
commit 9b801aee17
5 changed files with 13 additions and 12 deletions

View File

@ -31,11 +31,10 @@
#endif #endif
#endif #endif
#ifdef _WIN32
#undef fopen
void *fopen_utf8(const char * filename, const char * mode) void *fopen_utf8(const char * filename, const char * mode)
{ {
#if defined(_WIN32)
#undef fopen
#if defined(_XBOX) #if defined(_XBOX)
return fopen(filename, mode); return fopen(filename, mode);
#elif defined(LEGACY_WIN32) #elif defined(LEGACY_WIN32)
@ -56,5 +55,7 @@ void *fopen_utf8(const char * filename, const char * mode)
free(mode_w); free(mode_w);
return ret; return ret;
#endif #endif
} #else
return fopen(filename, mode);
#endif #endif
}

View File

@ -986,7 +986,7 @@ bool config_file_write(config_file_t *conf, const char *path, bool sort)
#ifdef ORBIS #ifdef ORBIS
int fd = orbisOpen(path,O_RDWR|O_CREAT,0644); int fd = orbisOpen(path,O_RDWR|O_CREAT,0644);
RARCH_LOG("[Config]config_file_write orbisOpen path=%s fd=%d\n", path, fd); RARCH_LOG("[Config]config_file_write orbisOpen path=%s fd=%d\n", path, fd);
if (fd<0) if (fd < 0)
return false; return false;
config_file_dump_orbis(conf,fd); config_file_dump_orbis(conf,fd);
orbisClose(fd); orbisClose(fd);

View File

@ -23,12 +23,12 @@
#ifndef __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H #ifndef __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H
#define __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
/* Defined to error rather than fopen_utf8, to make it clear to everyone reading the code that not worrying about utf16 is fine */ * clear to everyone reading the code that not worrying
* about UTF16 is fine. */
/* TODO: enable */ /* TODO: enable */
/* #define fopen (use fopen_utf8 instead) */ /* #define fopen (use fopen_utf8 instead) */
void *fopen_utf8(const char * filename, const char * mode); void *fopen_utf8(const char * filename, const char * mode);
#else
#define fopen_utf8 fopen
#endif
#endif #endif

View File

@ -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. /* Dump the current config to an already opened file.
* Does not close the 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 #ifdef ORBIS
void config_file_dump_orbis(config_file_t *conf, int fd); void config_file_dump_orbis(config_file_t *conf, int fd);
#endif #endif
void config_file_dump(config_file_t *conf, FILE *file, bool val);
bool config_file_exists(const char *path); bool config_file_exists(const char *path);

View File

@ -325,6 +325,7 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(const char *path, uns
#if !defined(PS2) /* TODO: PS2 IMPROVEMENT */ #if !defined(PS2) /* TODO: PS2 IMPROVEMENT */
stream->buf = (char*)calloc(1, 0x4000); stream->buf = (char*)calloc(1, 0x4000);
setvbuf(stream->fp, stream->buf, _IOFBF, 0x4000); setvbuf(stream->fp, stream->buf, _IOFBF, 0x4000);
#endif
#endif #endif
} }
else else