aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorMax Horn2011-05-03 14:14:21 +0200
committerMax Horn2011-05-03 14:14:21 +0200
commitff6533e1b3d9d65397ccc1876a0849075aad2430 (patch)
tree497c50c369e580365ef9b7d5a9cb6e1aad0b9f0b /backends/fs
parent48bbdd17082d79081787b6892889337a6dd52b24 (diff)
downloadscummvm-rg350-ff6533e1b3d9d65397ccc1876a0849075aad2430.tar.gz
scummvm-rg350-ff6533e1b3d9d65397ccc1876a0849075aad2430.tar.bz2
scummvm-rg350-ff6533e1b3d9d65397ccc1876a0849075aad2430.zip
PSP: Fix more forbidden symbol clashes
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/psp/psp-fs-factory.cpp21
-rw-r--r--backends/fs/psp/psp-fs.cpp22
2 files changed, 43 insertions, 0 deletions
diff --git a/backends/fs/psp/psp-fs-factory.cpp b/backends/fs/psp/psp-fs-factory.cpp
index 7fd8d8b077..6b0364b57e 100644
--- a/backends/fs/psp/psp-fs-factory.cpp
+++ b/backends/fs/psp/psp-fs-factory.cpp
@@ -24,8 +24,29 @@
#if defined(__PSP__)
+// Disable printf override in common/forbidden.h to avoid
+// clashes with pspdebug.h from the PSP SDK.
+// That header file uses
+// __attribute__((format(printf,1,2)));
+// which gets messed up by our override mechanism; this could
+// be avoided by either changing the PSP SDK to use the equally
+// legal and valid
+// __attribute__((format(__printf__,1,2)));
+// or by refining our printf override to use a varadic macro
+// (which then wouldn't be portable, though).
+// Anyway, for now we just disable the printf override globally
+// for the PSP port
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
+// Avoid clashes with unistd.h
+#define FORBIDDEN_SYMBOL_EXCEPTION_chdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_unlink
+
#include "backends/fs/psp/psp-fs-factory.h"
#include "backends/fs/psp/psp-fs.h"
+#include "backends/platform/psp/powerman.h"
+
+#include <unistd.h>
DECLARE_SINGLETON(PSPFilesystemFactory);
diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp
index e7fa265b31..b36b7a017c 100644
--- a/backends/fs/psp/psp-fs.cpp
+++ b/backends/fs/psp/psp-fs.cpp
@@ -24,6 +24,28 @@
#if defined(__PSP__)
+// Disable printf override in common/forbidden.h to avoid
+// clashes with pspdebug.h from the PSP SDK.
+// That header file uses
+// __attribute__((format(printf,1,2)));
+// which gets messed up by our override mechanism; this could
+// be avoided by either changing the PSP SDK to use the equally
+// legal and valid
+// __attribute__((format(__printf__,1,2)));
+// or by refining our printf override to use a varadic macro
+// (which then wouldn't be portable, though).
+// Anyway, for now we just disable the printf override globally
+// for the PSP port
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
+#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
+
+#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+
+// Avoid clashes with unistd.h
+#define FORBIDDEN_SYMBOL_EXCEPTION_chdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_unlink
+
#include "backends/fs/psp/psp-fs.h"
#include "backends/fs/psp/psp-stream.h"
#include "common/bufferedstream.h"