diff options
author | Max Horn | 2011-05-03 10:33:03 +0200 |
---|---|---|
committer | Max Horn | 2011-05-03 13:22:00 +0200 |
commit | f62fd4f25f5fcc237d59054af0d6182da8d8eff8 (patch) | |
tree | 05fd53a36cd791f91419e261a547c7c2406daa98 /backends/fs/posix | |
parent | 5ea9e14c2fcd3c1054ce95867ca7df7c8498a2d8 (diff) | |
download | scummvm-rg350-f62fd4f25f5fcc237d59054af0d6182da8d8eff8.tar.gz scummvm-rg350-f62fd4f25f5fcc237d59054af0d6182da8d8eff8.tar.bz2 scummvm-rg350-f62fd4f25f5fcc237d59054af0d6182da8d8eff8.zip |
BACKENDS: Avoid #including .cpp files
So far, the various *-fs-factory.cpp files were #including the
corresponding *-fs.cpp files. This is surprising and hence could lead to
all kinds of problems). To fix this, provide proper headers for the
*-fs.cpp files.
This also makes code reuse via subclassing possible.
Since not all ports were tested, this will likely lead to a few
easy to fix compile regressions.
Diffstat (limited to 'backends/fs/posix')
-rw-r--r-- | backends/fs/posix/posix-fs-factory.cpp | 2 | ||||
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 9 | ||||
-rw-r--r-- | backends/fs/posix/posix-fs.h | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index 4d23a9e095..a69cf6b3b4 100644 --- a/backends/fs/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -30,7 +30,7 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_unlink #include "backends/fs/posix/posix-fs-factory.h" -#include "backends/fs/posix/posix-fs.cpp" +#include "backends/fs/posix/posix-fs.h" AbstractFSNode *POSIXFilesystemFactory::makeRootFileNode() const { return new POSIXFilesystemNode("/"); diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index b218e9dd59..7aa17e5cc1 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -24,6 +24,11 @@ #if defined(UNIX) +// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. +#define FORBIDDEN_SYMBOL_EXCEPTION_chdir +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_unlink + #include "backends/fs/posix/posix-fs.h" #include "backends/fs/stdiostream.h" #include "common/algorithm.h" @@ -238,11 +243,11 @@ AbstractFSNode *POSIXFilesystemNode::getParent() const { } Common::SeekableReadStream *POSIXFilesystemNode::createReadStream() { - return StdioStream::makeFromPath(getPath().c_str(), false); + return StdioStream::makeFromPath(getPath(), false); } Common::WriteStream *POSIXFilesystemNode::createWriteStream() { - return StdioStream::makeFromPath(getPath().c_str(), true); + return StdioStream::makeFromPath(getPath(), true); } #endif //#if defined(UNIX) diff --git a/backends/fs/posix/posix-fs.h b/backends/fs/posix/posix-fs.h index 859e8973b3..003a0b38d0 100644 --- a/backends/fs/posix/posix-fs.h +++ b/backends/fs/posix/posix-fs.h @@ -83,4 +83,4 @@ private: virtual void setFlags(); }; -#endif /*POSIX_FILESYSTEM_H*/ +#endif |