diff --git a/CMakeLists.txt b/CMakeLists.txt index ca652ca09..6998ef3a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,7 +330,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") find_function(localtime_r) # The strtof_l on Linux not actually exposed nor actually strtof_l set(HAVE_STRTOF_L OFF) -elseif(NOT DEFINED PSP2) +else() find_function(localtime_r) find_function(strtof_l) endif() diff --git a/src/platform/psp2/CMakeLists.txt b/src/platform/psp2/CMakeLists.txt index 60d37e070..393f63a4d 100644 --- a/src/platform/psp2/CMakeLists.txt +++ b/src/platform/psp2/CMakeLists.txt @@ -3,7 +3,7 @@ include("${VITASDK}/share/vita.cmake" REQUIRED) find_program(OBJCOPY ${cross_prefix}objcopy) find_file(NIDDB db.json PATHS ${VITASDK} ${VITASDK}/bin ${VITASDK}/share) -set(OS_DEFINES IOAPI_NO_64) +set(OS_DEFINES IOAPI_NO_64 _GNU_SOURCE) set(OS_DEFINES ${OS_DEFINES} PARENT_SCOPE) file(GLOB OS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/psp2-*.c) diff --git a/src/platform/psp2/sce-vfs.c b/src/platform/psp2/sce-vfs.c index 22b05950f..d5a52f177 100644 --- a/src/platform/psp2/sce-vfs.c +++ b/src/platform/psp2/sce-vfs.c @@ -90,7 +90,7 @@ struct VFile* VFileOpenSce(const char* path, int flags, SceMode mode) { bool _vfsceClose(struct VFile* vf) { struct VFileSce* vfsce = (struct VFileSce*) vf; - sceIoSyncByFd(vfsce->fd); + sceIoSyncByFd(vfsce->fd, 0); return sceIoClose(vfsce->fd) >= 0; } @@ -128,7 +128,7 @@ static void _vfsceUnmap(struct VFile* vf, void* memory, size_t size) { sceIoLseek(vfsce->fd, 0, SEEK_SET); sceIoWrite(vfsce->fd, memory, size); sceIoLseek(vfsce->fd, cur, SEEK_SET); - sceIoSyncByFd(vfsce->fd); + sceIoSyncByFd(vfsce->fd, 0); mappedMemoryFree(memory, size); } @@ -155,7 +155,7 @@ bool _vfsceSync(struct VFile* vf, void* buffer, size_t size) { sceIoLseek(vfsce->fd, cur, SEEK_SET); return res == size; } - return sceIoSyncByFd(vfsce->fd) >= 0; + return sceIoSyncByFd(vfsce->fd, 0) >= 0; } struct VDir* VDirOpen(const char* path) {