Fix linker issues when doing a plugin build, and (hopefully) also on Windows

svn-id: r28950
This commit is contained in:
Max Horn 2007-09-18 21:34:57 +00:00
parent 162460d18a
commit ab8997f64d
11 changed files with 24 additions and 17 deletions

View file

@ -60,7 +60,7 @@
* *
* @return AbstractFilesystemFactory* The specific factory for the current architecture. * @return AbstractFilesystemFactory* The specific factory for the current architecture.
*/ */
static AbstractFilesystemFactory *makeFSFactory() { AbstractFilesystemFactory *AbstractFilesystemFactory::makeFSFactory() {
#if defined(__amigaos4__) #if defined(__amigaos4__)
return &AmigaOSFilesystemFactory::instance(); return &AmigaOSFilesystemFactory::instance();
#elif defined(__DC__) #elif defined(__DC__)

View file

@ -25,6 +25,7 @@
#ifndef ABSTRACT_FILESYSTEM_FACTORY_H #ifndef ABSTRACT_FILESYSTEM_FACTORY_H
#define ABSTRACT_FILESYSTEM_FACTORY_H #define ABSTRACT_FILESYSTEM_FACTORY_H
#include "common/stdafx.h"
#include "common/str.h" #include "common/str.h"
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
@ -68,6 +69,13 @@ public:
* On Windows, it will be a special node which "contains" all drives (C:, D:, E:). * On Windows, it will be a special node which "contains" all drives (C:, D:, E:).
*/ */
virtual AbstractFilesystemNode *makeRootFileNode() const = 0; virtual AbstractFilesystemNode *makeRootFileNode() const = 0;
/**
* Meta-factory method which returns a concrete AbstractFilesystemFactory
* instance depending on the current architecture.
*/
static AbstractFilesystemFactory *makeFSFactory();
}; };
#endif /*ABSTRACT_FILESYSTEM_FACTORY_H*/ #endif /*ABSTRACT_FILESYSTEM_FACTORY_H*/

View file

@ -81,7 +81,7 @@ public:
* @param str String containing the path. * @param str String containing the path.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;

View file

@ -82,7 +82,7 @@ const char gpRootPath[] = "gp:\\";
* @param str Path to obtain the last component from. * @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;
@ -214,7 +214,7 @@ bool GP32FilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
//listDir += "/"; //listDir += "/";
while (GpDirEnumList(listDir.c_str(), startIdx++, 1, &dirEntry, &read) == SM_OK) { while (GpDirEnumList(listDir.c_str(), startIdx++, 1, &dirEntry, &read) == SM_OK) {
if (dirEntry.name[0] == '.') da if (dirEntry.name[0] == '.')
continue; continue;
entry._displayName = dirEntry.name; entry._displayName = dirEntry.name;

View file

@ -92,7 +92,7 @@ private:
* @param str String containing the path. * @param str String containing the path.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;

View file

@ -91,7 +91,7 @@ private:
* @param str String containing the path. * @param str String containing the path.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;

View file

@ -82,7 +82,7 @@ public:
* @param str String containing the path. * @param str String containing the path.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;

View file

@ -83,7 +83,7 @@ public:
* @param str Path to obtain the last component from. * @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;

View file

@ -124,7 +124,7 @@ private:
* @param str Path to obtain the last component from. * @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
static const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str(); const char *start = str.c_str();
const char *cur = start + str.size() - 2; const char *cur = start + str.size() - 2;

View file

@ -2,11 +2,7 @@ MODULE := backends
MODULE_OBJS := \ MODULE_OBJS := \
events/default/default-events.o \ events/default/default-events.o \
fs/posix/posix-fs.o \ fs/abstract-fs-factory.o \
fs/morphos/abox-fs.o \
fs/windows/windows-fs.o \
fs/amigaos4/amigaos4-fs.o \
fs/dc/dc-fs.o \
midi/alsa.o \ midi/alsa.o \
midi/coreaudio.o \ midi/coreaudio.o \
midi/coremidi.o \ midi/coremidi.o \

View file

@ -25,9 +25,9 @@
#include "common/stdafx.h" #include "common/stdafx.h"
#include "common/util.h" #include "common/util.h"
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/fs-factory-maker.cpp" #include "backends/fs/abstract-fs-factory.h"
/* /**
* Simple DOS-style pattern matching function (understands * and ? like used in DOS). * Simple DOS-style pattern matching function (understands * and ? like used in DOS).
* Taken from exult/files/listfiles.cc * Taken from exult/files/listfiles.cc
*/ */
@ -82,7 +82,7 @@ FilesystemNode::FilesystemNode(const FilesystemNode &node) {
} }
FilesystemNode::FilesystemNode(const Common::String &p) { FilesystemNode::FilesystemNode(const Common::String &p) {
AbstractFilesystemFactory *factory = makeFSFactory(); AbstractFilesystemFactory *factory = AbstractFilesystemFactory::makeFSFactory();
if (p.empty() || p == ".") if (p.empty() || p == ".")
_realNode = factory->makeCurrentDirectoryFileNode(); _realNode = factory->makeCurrentDirectoryFileNode();
@ -234,6 +234,9 @@ bool FilesystemNode::lookupFile(FSList &results, FilesystemNode &dir, Common::St
return ((matches > 0) ? true : false); return ((matches > 0) ? true : false);
} }
// HACK HACK HACK
extern const char *lastPathComponent(const Common::String &str);
int FilesystemNode::lookupFileRec(FSList &results, FilesystemNode &dir, Common::String &filename, bool hidden, bool exhaustive) const int FilesystemNode::lookupFileRec(FSList &results, FilesystemNode &dir, Common::String &filename, bool hidden, bool exhaustive) const
{ {
FSList entries; FSList entries;