Commit | Line | Data |
---|---|---|
7bf7acb6 GI |
1 | #ifndef LIBPICOFE_POSIX_H |
2 | #define LIBPICOFE_POSIX_H | |
3 | ||
f15ca4db | 4 | /* define POSIX stuff: dirent, scandir, getcwd, mkdir */ |
5d636caa | 5 | #if defined(__MACH__) || defined(__linux__) || defined(__MINGW32__) |
049a6b3e | 6 | |
7 | #include <dirent.h> | |
8 | #include <unistd.h> | |
f15ca4db | 9 | #include <sys/stat.h> |
10 | #include <sys/types.h> | |
049a6b3e | 11 | |
8ced8d2b | 12 | #ifdef __MINGW32__ |
13 | #warning hacks! | |
14 | #define mkdir(pathname,mode) mkdir(pathname) | |
15 | #define d_type d_ino | |
16 | #define DT_REG 0 | |
17 | #define DT_DIR 0 | |
18 | #endif | |
19 | ||
dfe767a5 | 20 | #elif defined(__PSP__) |
21 | ||
22 | #include <dirent.h> | |
23 | #include <unistd.h> | |
24 | #include <sys/stat.h> | |
25 | ||
1889fe24 | 26 | #ifndef DT_DIR |
dfe767a5 | 27 | /* map PSP names to posix. needs special scandir() function to mask rwx bits */ |
28 | #define d_type d_stat.st_attr | |
29 | #define DT_LNK FIO_SO_IFLNK | |
30 | #define DT_DIR FIO_SO_IFDIR | |
31 | #define DT_REG FIO_SO_IFREG | |
32 | #define DT_UNKNOWN 0 | |
1889fe24 | 33 | #endif |
dfe767a5 | 34 | |
049a6b3e | 35 | #else |
36 | ||
f15ca4db | 37 | #error "must provide posix" |
049a6b3e | 38 | |
39 | #endif | |
40 | ||
7bf7acb6 | 41 | #endif // LIBPICOFE_POSIX_H |