mirror of https://github.com/mgba-emu/mgba.git
VFS: Rename USE_VFS_* to ENABLE_VFS_*
This commit is contained in:
parent
96702f7db1
commit
88a8f80ebd
|
@ -98,7 +98,7 @@ bool VDirCreate(const char* path);
|
||||||
struct VFile* VDirFindFirst(struct VDir* dir, bool (*filter)(struct VFile*));
|
struct VFile* VDirFindFirst(struct VDir* dir, bool (*filter)(struct VFile*));
|
||||||
struct VFile* VDirFindNextAvailable(struct VDir*, const char* basename, const char* infix, const char* suffix, int mode);
|
struct VFile* VDirFindNextAvailable(struct VDir*, const char* basename, const char* infix, const char* suffix, int mode);
|
||||||
|
|
||||||
#ifdef USE_VFS_FILE
|
#ifdef ENABLE_VFS_FILE
|
||||||
struct VFile* VFileFOpen(const char* path, const char* mode);
|
struct VFile* VFileFOpen(const char* path, const char* mode);
|
||||||
struct VFile* VFileFromFILE(FILE* file);
|
struct VFile* VFileFromFILE(FILE* file);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
#include <mgba-util/platform/3ds/3ds-vfs.h>
|
#include <mgba-util/platform/3ds/3ds-vfs.h>
|
||||||
|
|
||||||
#ifdef USE_VFS_3DS
|
#ifdef ENABLE_VFS_3DS
|
||||||
#include <mgba-util/memory.h>
|
#include <mgba-util/memory.h>
|
||||||
#include <mgba-util/string.h>
|
#include <mgba-util/string.h>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
set(USE_VFS_3DS OFF CACHE BOOL "Use 3DS-specific file support")
|
set(ENABLE_VFS_3DS OFF CACHE BOOL "Use 3DS-specific file support")
|
||||||
mark_as_advanced(USE_VFS_3DS)
|
mark_as_advanced(ENABLE_VFS_3DS)
|
||||||
|
|
||||||
find_program(3DSLINK 3dslink)
|
find_program(3DSLINK 3dslink)
|
||||||
find_program(3DSXTOOL 3dsxtool)
|
find_program(3DSXTOOL 3dsxtool)
|
||||||
|
@ -28,8 +28,8 @@ set(OS_SRC
|
||||||
set(OS_LIB ${OS_LIB} PARENT_SCOPE)
|
set(OS_LIB ${OS_LIB} PARENT_SCOPE)
|
||||||
source_group("3DS-specific code" FILES ${OS_SRC})
|
source_group("3DS-specific code" FILES ${OS_SRC})
|
||||||
|
|
||||||
if(USE_VFS_3DS)
|
if(ENABLE_VFS_3DS)
|
||||||
list(APPEND OS_DEFINES USE_VFS_3DS)
|
list(APPEND OS_DEFINES ENABLE_VFS_3DS)
|
||||||
else()
|
else()
|
||||||
list(APPEND VFS_SRC ${PROJECT_SOURCE_DIR}/src/util/vfs/vfs-fd.c ${PROJECT_SOURCE_DIR}/src/util/vfs/vfs-dirent.c)
|
list(APPEND VFS_SRC ${PROJECT_SOURCE_DIR}/src/util/vfs/vfs-fd.c ${PROJECT_SOURCE_DIR}/src/util/vfs/vfs-dirent.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#ifdef ENABLE_VFS
|
||||||
struct VFile* VFileOpen(const char* path, int flags) {
|
struct VFile* VFileOpen(const char* path, int flags) {
|
||||||
#ifdef USE_VFS_FILE
|
#ifdef ENABLE_VFS_FILE
|
||||||
const char* chflags;
|
const char* chflags;
|
||||||
switch (flags & O_ACCMODE) {
|
switch (flags & O_ACCMODE) {
|
||||||
case O_WRONLY:
|
case O_WRONLY:
|
||||||
|
@ -68,7 +68,7 @@ struct VFile* VFileOpen(const char* path, int flags) {
|
||||||
sceFlags |= SCE_O_CREAT;
|
sceFlags |= SCE_O_CREAT;
|
||||||
}
|
}
|
||||||
return VFileOpenSce(path, sceFlags, 0666);
|
return VFileOpenSce(path, sceFlags, 0666);
|
||||||
#elif defined(USE_VFS_3DS)
|
#elif defined(ENABLE_VFS_3DS)
|
||||||
int ctrFlags = FS_OPEN_READ;
|
int ctrFlags = FS_OPEN_READ;
|
||||||
switch (flags & O_ACCMODE) {
|
switch (flags & O_ACCMODE) {
|
||||||
case O_WRONLY:
|
case O_WRONLY:
|
||||||
|
|
Loading…
Reference in New Issue