summaryrefslogtreecommitdiff
path: root/firmware/include
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-06-21 16:53:00 +0000
committerThomas Martitz <kugel@rockbox.org>2010-06-21 16:53:00 +0000
commit35e8b1429a2cdcf6580f6d25890fed9865165d0b (patch)
tree084be19a29bffa879eee8e3cad92d8f3b342a337 /firmware/include
parent02e04585bdf1fbd00cf84d2000f59ec198440cb3 (diff)
Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/dbgcheck.h4
-rw-r--r--firmware/include/dir_uncached.h6
-rw-r--r--firmware/include/dircache.h2
-rw-r--r--firmware/include/file.h5
4 files changed, 9 insertions, 8 deletions
diff --git a/firmware/include/dbgcheck.h b/firmware/include/dbgcheck.h
index e1f7aefbdb..0b38627d11 100644
--- a/firmware/include/dbgcheck.h
+++ b/firmware/include/dbgcheck.h
@@ -4,7 +4,7 @@
#include <stdbool.h>
#ifdef DEBUG
- #ifndef SIMULATOR
+ #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* check whether a function is inside the valid memory location */
#define IS_FUNCPTR(fp) ({/
extern char _text[];/
@@ -21,4 +21,4 @@
#endif
-#endif // #ifndef __DBGCHECK_H__ \ No newline at end of file
+#endif // #ifndef __DBGCHECK_H__
diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h
index 4e5acf34d1..f225cf8e39 100644
--- a/firmware/include/dir_uncached.h
+++ b/firmware/include/dir_uncached.h
@@ -32,7 +32,7 @@
#define ATTR_ARCHIVE 0x20
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
#define dirent_uncached sim_dirent
#define DIR_UNCACHED SIM_DIR
#define opendir_uncached sim_opendir
@@ -57,7 +57,7 @@ struct dirent_uncached {
#include "fat.h"
typedef struct {
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
bool busy;
long startcluster;
struct fat_dir fatdir;
@@ -66,7 +66,7 @@ typedef struct {
int volumecounter; /* running counter for faked volume entries */
#endif
#else
- /* simulator: */
+ /* simulator/application: */
void *dir; /* actually a DIR* dir */
char *name;
#endif
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h
index 9fd55fab6f..4472d5fbe0 100644
--- a/firmware/include/dircache.h
+++ b/firmware/include/dircache.h
@@ -36,7 +36,7 @@ struct travel_data {
struct dircache_entry *first;
struct dircache_entry *ce;
struct dircache_entry *down_entry;
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
DIR_UNCACHED *dir, *newdir;
struct dirent_uncached *entry;
#else
diff --git a/firmware/include/file.h b/firmware/include/file.h
index f66cc6c60e..9502f5999a 100644
--- a/firmware/include/file.h
+++ b/firmware/include/file.h
@@ -26,6 +26,7 @@
#define MAX_PATH 260
#include <sys/types.h>
+#include "config.h"
#include "_ansi.h"
#define MAX_OPEN_FILES 11
@@ -49,7 +50,7 @@
#define O_TRUNC 0x10
#endif
-#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(PLUGIN) && !defined(CODEC)
#define open(x, ...) sim_open(x, __VA_ARGS__)
#define creat(x,m) sim_creat(x,m)
#define remove(x) sim_remove(x)
@@ -78,7 +79,7 @@ extern int fsync(int fd);
extern ssize_t read(int fd, void *buf, size_t count);
extern off_t lseek(int fildes, off_t offset, int whence);
extern int file_creat(const char *pathname);
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* posix compatibility function */
static inline int creat(const char *pathname, mode_t mode)
{