diff --git a/libretro/libretro-common/include/streams/file_stream_transforms.h b/libretro/libretro-common/include/streams/file_stream_transforms.h index 602cc93..bf7b6a9 100644 --- a/libretro/libretro-common/include/streams/file_stream_transforms.h +++ b/libretro/libretro-common/include/streams/file_stream_transforms.h @@ -1,7 +1,7 @@ /* Copyright (C) 2010-2017 The RetroArch team * * --------------------------------------------------------------------------------------- -* The following license statement only applies to this file (file_stream.h). +* The following license statement only applies to this file (file_stream_transforms.h). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, @@ -24,6 +24,7 @@ #define __LIBRETRO_SDK_FILE_STREAM_TRANSFORMS_H #include +#include #include RETRO_BEGIN_DECLS @@ -38,56 +39,51 @@ RETRO_BEGIN_DECLS #define fgets rfgets #define fwrite rfwrite -inline RFILE* rfopen(const char* path, char* mode) +static INLINE RFILE* rfopen(const char *path, char *mode) { - unsigned int retro_mode = RFILE_MODE_READ_TEXT; - if (strstr(mode, "r")) - { - if (strstr(mode, "b")) - { - retro_mode = RFILE_MODE_READ; - } - } - if (strstr(mode, "w")) - { - retro_mode = RFILE_MODE_WRITE; - } - if (strstr(mode, "+")) - { - retro_mode = RFILE_MODE_READ_WRITE; - } + unsigned int retro_mode = RFILE_MODE_READ_TEXT; + if (strstr(mode, "r")) + if (strstr(mode, "b")) + retro_mode = RFILE_MODE_READ; - return filestream_open(path, retro_mode, -1); + if (strstr(mode, "w")) + retro_mode = RFILE_MODE_WRITE; + if (strstr(mode, "+")) + retro_mode = RFILE_MODE_READ_WRITE; + + return filestream_open(path, retro_mode, -1); } -inline int rfclose(RFILE* stream) +static INLINE int rfclose(RFILE* stream) { - return filestream_close(stream); + return filestream_close(stream); } -inline long rftell(RFILE* stream) +static INLINE long rftell(RFILE* stream) { - return filestream_tell(stream); + return filestream_tell(stream); } -inline int rfseek(RFILE* stream, long offset, int origin) +static INLINE int rfseek(RFILE* stream, long offset, int origin) { - return filestream_seek(stream, offset, origin); + return filestream_seek(stream, offset, origin); } -inline size_t rfread(void* buffer, size_t elementSize, size_t elementCount, RFILE* stream) +static INLINE size_t rfread(void* buffer, + size_t elementSize, size_t elementCount, RFILE* stream) { - return filestream_read(stream, buffer, elementSize*elementCount); + return filestream_read(stream, buffer, elementSize*elementCount); } -inline char* rfgets(char* buffer, int maxCount, FILE* stream) +static INLINE char *rfgets(char *buffer, int maxCount, FILE* stream) { - return filestream_gets(stream, buffer, maxCount); + return filestream_gets(stream, buffer, maxCount); } -inline size_t rfwrite(void const* buffer, size_t elementSize, size_t elementCount, RFILE* stream) +static INLINE size_t rfwrite(void const* buffer, + size_t elementSize, size_t elementCount, RFILE* stream) { - return filestream_write(stream, buffer, elementSize*elementCount); + return filestream_write(stream, buffer, elementSize*elementCount); } RETRO_END_DECLS