Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,9 +1,10 @@ AC_INIT(ObjFW, 0.4-dev, js@webkeks.org) AC_CONFIG_SRCDIR(src) AS_IF([test x"$host" = x"psp"], [ + OBJCFLAGS="-G0 $OBJCFLAGS" LIBS="$LIBS -lc -lpspkernel -lpspuser" LIBS="$LIBS -lpspnet -lpspnet_inet -lpspnet_resolver" ]) AC_CANONICAL_HOST Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -107,10 +107,11 @@ /** * \return The date of the last modification of the file */ + (OFDate*)modificationDateOfFile: (OFString*)path; +#ifndef _PSP /** * Changes the mode of a file. * * Only changes read-only flag on Windows. * @@ -118,12 +119,13 @@ * string * \param mode The new mode for the file */ + (void)changeModeOfFile: (OFString*)path toMode: (mode_t)mode; +#endif -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_PSP) /** * Changes the owner of a file. * * Not available on Windows. * Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -396,19 +396,20 @@ if (chdir([path cString])) @throw [OFChangeDirectoryFailedException newWithClass: self path: path]; } +#ifndef _PSP + (void)changeModeOfFile: (OFString*)path toMode: (mode_t)mode { -#ifndef _WIN32 +# ifndef _WIN32 if (chmod([path cString], mode)) @throw [OFChangeFileModeFailedException newWithClass: self path: path mode: mode]; -#else +# else DWORD attrs = GetFileAttributes([path cString]); if (attrs == INVALID_FILE_ATTRIBUTES) @throw [OFChangeFileModeFailedException newWithClass: self path: path @@ -421,12 +422,13 @@ if (!SetFileAttributes([path cString], attrs)) @throw [OFChangeFileModeFailedException newWithClass: self path: path mode: mode]; -#endif +# endif } +#endif + (OFDate*)modificationDateOfFile: (OFString*)path { struct stat s; @@ -438,11 +440,11 @@ /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_mtime]; } -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_PSP) + (void)changeOwnerOfFile: (OFString*)path toOwner: (OFString*)owner group: (OFString*)group { uid_t uid = -1; @@ -526,11 +528,11 @@ intoBuffer: buf]; [dest writeNBytes: len fromBuffer: buf]; } -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_PSP) if (!override) { struct stat s; if (fstat(src->fd, &s) == 0) fchmod(dest->fd, s.st_mode); Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -118,17 +118,19 @@ #if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME) objc_setEnumerationMutationHandler(enumeration_mutation_handler); #endif -#ifndef _WIN32 - if ((of_pagesize = sysconf(_SC_PAGESIZE)) < 1) - of_pagesize = 4096; -#else +#if defined(_WIN32) SYSTEM_INFO si; GetSystemInfo(&si); of_pagesize = si.dwPageSize; +#elif defined(_PSP) + of_pagesize = 512; +#else + if ((of_pagesize = sysconf(_SC_PAGESIZE)) < 1) + of_pagesize = 4096; #endif } + (void)initialize {