aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/posix
diff options
context:
space:
mode:
authorMarcus Comstedt2003-11-03 22:20:51 +0000
committerMarcus Comstedt2003-11-03 22:20:51 +0000
commite55370e08db26a871d47405208e8f8e5852afcbc (patch)
treefd4cc2c3fa55484b8c2b1ecf204075eddcc5d1fc /backends/fs/posix
parentd85757987e893f53a34e08e6ef912dc86ffe619f (diff)
downloadscummvm-rg350-e55370e08db26a871d47405208e8f8e5852afcbc.tar.gz
scummvm-rg350-e55370e08db26a871d47405208e8f8e5852afcbc.tar.bz2
scummvm-rg350-e55370e08db26a871d47405208e8f8e5852afcbc.zip
Use posix-fs on Dreamcast.
svn-id: r11112
Diffstat (limited to 'backends/fs/posix')
-rw-r--r--backends/fs/posix/posix-fs.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 43574ac818..4475e82abd 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -18,7 +18,9 @@
* $Header$
*/
-#if defined(UNIX) || defined (__GP32__) //ph0x
+#if defined(UNIX) || defined(__DC__) || defined (__GP32__) //ph0x
+
+#include "stdafx.h"
#include "../fs.h"
@@ -27,7 +29,9 @@
#endif
#include <sys/param.h>
#include <sys/stat.h>
+#ifndef __DC__
#include <dirent.h>
+#endif
#include <stdio.h>
#include <unistd.h>
@@ -80,7 +84,7 @@ FilesystemNode *FilesystemNode::getRoot() {
}
POSIXFilesystemNode::POSIXFilesystemNode() {
-#if 1
+#ifndef __DC__
char buf[MAXPATHLEN];
getcwd(buf, MAXPATHLEN);
@@ -134,9 +138,13 @@ FSList *POSIXFilesystemNode::listDir(ListMode mode) const {
entry._path = _path;
entry._path += dp->d_name;
+#ifdef __DC__
+ entry._isDirectory = dp->d_size < 0;
+#else
if (stat(entry._path.c_str(), &st))
continue;
entry._isDirectory = S_ISDIR(st.st_mode);
+#endif
// Honor the chosen mode
if ((mode == kListFilesOnly && entry._isDirectory) ||