aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/ds
diff options
context:
space:
mode:
authorMax Horn2007-03-08 17:36:52 +0000
committerMax Horn2007-03-08 17:36:52 +0000
commitd19adc0514d8a43f3a233649595c636d5c38b3d5 (patch)
treecd503b5f17faf59aef5ab928398245a7f705dd22 /backends/fs/ds
parent8778f121e2330b5025755ddc57077a5b87fc3693 (diff)
downloadscummvm-rg350-d19adc0514d8a43f3a233649595c636d5c38b3d5.tar.gz
scummvm-rg350-d19adc0514d8a43f3a233649595c636d5c38b3d5.tar.bz2
scummvm-rg350-d19adc0514d8a43f3a233649595c636d5c38b3d5.zip
common/util.cpp needs fprintf; various std I/O functions are not used by anything in our code, so there is no need to emulate them -- mark these; my previous commits likely broke compilation of the DS backend, try to reduce the brokeness a bit
svn-id: r26023
Diffstat (limited to 'backends/fs/ds')
-rw-r--r--backends/fs/ds/ds-fs.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index 883ad2d7ca..26a95976e6 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -27,8 +27,34 @@
#include "dsmain.h"
#include "gba_nds_fat.h"
+
namespace DS {
+struct fileHandle {
+ int pos;
+ bool used;
+ char* data;
+ int size;
+
+ DSSaveFile* sramFile;
+};
+
+#define FILE DS::fileHandle
+
+// FIXME: The following definition for stdin etc. are duplicated in common/util.cpp.
+// This should be fixed, e.g. by moving this (and the declarations of fileHandle,
+// the various functions etc.) into a separate header file which includes by util.cpp,
+// file.cpp and ds-fs.cpp
+
+#undef stderr
+#undef stdout
+#undef stdin
+
+#define stdout ((DS::fileHandle*) -1)
+#define stderr ((DS::fileHandle*) -2)
+#define stdin ((DS::fileHandle*) -3)
+
+
//////////////////////////////////////////////////////////////
// DSFileSystemNode - Flash ROM file system using Zip files
//////////////////////////////////////////////////////////////
@@ -434,7 +460,7 @@ FILE* std_fopen(const char* name, const char* mode) {
}
// MT_memoryReport();
- return (fileHandle *) result;
+ return (FILE *) result;
}