3DS: Use newlib fs functions unless told otherwise

This commit is contained in:
Jeffrey Pfau 2015-08-24 19:18:32 -07:00
parent 85298a0a54
commit fb82257d03
4 changed files with 11 additions and 1 deletions

View File

@ -176,6 +176,12 @@ elseif(3DS)
include_directories(${CMAKE_BINARY_DIR})
list(APPEND OS_LIB sf2d ctru)
file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/3ds/*.c ${CMAKE_BINARY_DIR}/font.c)
if(USE_VFS_3DS)
add_definitions(-DUSE_VFS_3DS)
else()
add_definitions(-DUSE_VFS_FILE)
list(APPEND VFS_SRC ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-file.c ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-dirent.c)
endif()
source_group("3DS-specific code" FILES ${OS_SRC})
endif()

View File

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "3ds-vfs.h"
#ifdef USE_VFS_3DS
#include "util/memory.h"
#include "util/string.h"
@ -244,3 +245,4 @@ static const char* _vd3deName(struct VDirEntry* vde) {
}
return vd3de->utf8Name;
}
#endif

View File

@ -64,6 +64,7 @@ int main() {
aptInit();
hidInit(0);
fsInit();
sdmcInit();
sf2d_init();
sf2d_set_clear_color(0);
@ -139,6 +140,7 @@ cleanup:
sf2d_free_texture(tex);
sf2d_fini();
sdmcExit();
fsExit();
gfxExit();
hidExit();

View File

@ -34,7 +34,7 @@ struct VFile* VFileOpen(const char* path, int flags) {
break;
}
return VFileFOpen(path, chflags);
#elif defined(_3DS)
#elif defined(USE_VFS_3DS)
int ctrFlags = FS_OPEN_READ;
switch (flags & O_ACCMODE) {
case O_WRONLY: