X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=posix.h;h=44b6984d2fd1c994b5e6d24f3f6ca40730f6f8a5;hb=7b58e15633b54621f9508cb673da61a6b0844955;hp=35f4d2836a1eed84ab04ea867e0b26aa0113b035;hpb=7bf7acb6d60e16e9eaa208761d019c39da396fc0;p=libpicofe.git diff --git a/posix.h b/posix.h index 35f4d28..44b6984 100644 --- a/posix.h +++ b/posix.h @@ -2,7 +2,7 @@ #define LIBPICOFE_POSIX_H /* define POSIX stuff: dirent, scandir, getcwd, mkdir */ -#if defined(__linux__) || defined(__MINGW32__) +#if defined(__MACH__) || defined(__linux__) || defined(__MINGW32__) #include #include @@ -17,6 +17,21 @@ #define DT_DIR 0 #endif +#elif defined(__PSP__) + +#include +#include +#include + +#ifndef DT_DIR +/* map PSP names to posix. needs special scandir() function to mask rwx bits */ +#define d_type d_stat.st_attr +#define DT_LNK FIO_SO_IFLNK +#define DT_DIR FIO_SO_IFDIR +#define DT_REG FIO_SO_IFREG +#define DT_UNKNOWN 0 +#endif + #else #error "must provide posix"