in_sdl: give names to gamepad buttons
[libpicofe.git] / posix.h
diff --git a/posix.h b/posix.h
index 257c27f..8351def 100644 (file)
--- a/posix.h
+++ b/posix.h
@@ -2,7 +2,7 @@
 #define LIBPICOFE_POSIX_H
 
 /* define POSIX stuff: dirent, scandir, getcwd, mkdir */
-#if defined(__MACH__) || defined(__linux__) || defined(__MINGW32__)
+#if defined(__FreeBSD__) || defined(__MACH__) || defined(__linux__) || defined(__MINGW32__) || defined(__PSP__) || defined(__PS2__)
 
 #include <dirent.h>
 #include <unistd.h>
 #define mkdir(pathname,mode) mkdir(pathname)
 #define d_type d_ino
 #define DT_REG 0
-#define DT_DIR 0
+#define DT_DIR 1
+#define DT_LNK 2
+#define DT_UNKNOWN -1
+#define readlink(p,d,s)                -1
 #endif
 
-#elif defined(__PSP__)
-
-#include <dirent.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-/* 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
-
 #else
 
 #error "must provide posix"