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)
downloadrockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.gz
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.zip
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 @@
4#include <stdbool.h> 4#include <stdbool.h>
5 5
6#ifdef DEBUG 6#ifdef DEBUG
7 #ifndef SIMULATOR 7 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
8 /* check whether a function is inside the valid memory location */ 8 /* check whether a function is inside the valid memory location */
9 #define IS_FUNCPTR(fp) ({/ 9 #define IS_FUNCPTR(fp) ({/
10 extern char _text[];/ 10 extern char _text[];/
@@ -21,4 +21,4 @@
21#endif 21#endif
22 22
23 23
24#endif // #ifndef __DBGCHECK_H__ \ No newline at end of file 24#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 @@
32#define ATTR_ARCHIVE 0x20 32#define ATTR_ARCHIVE 0x20
33#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ 33#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
34 34
35#ifdef SIMULATOR 35#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
36#define dirent_uncached sim_dirent 36#define dirent_uncached sim_dirent
37#define DIR_UNCACHED SIM_DIR 37#define DIR_UNCACHED SIM_DIR
38#define opendir_uncached sim_opendir 38#define opendir_uncached sim_opendir
@@ -57,7 +57,7 @@ struct dirent_uncached {
57#include "fat.h" 57#include "fat.h"
58 58
59typedef struct { 59typedef struct {
60#ifndef SIMULATOR 60#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
61 bool busy; 61 bool busy;
62 long startcluster; 62 long startcluster;
63 struct fat_dir fatdir; 63 struct fat_dir fatdir;
@@ -66,7 +66,7 @@ typedef struct {
66 int volumecounter; /* running counter for faked volume entries */ 66 int volumecounter; /* running counter for faked volume entries */
67#endif 67#endif
68#else 68#else
69 /* simulator: */ 69 /* simulator/application: */
70 void *dir; /* actually a DIR* dir */ 70 void *dir; /* actually a DIR* dir */
71 char *name; 71 char *name;
72#endif 72#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 {
36 struct dircache_entry *first; 36 struct dircache_entry *first;
37 struct dircache_entry *ce; 37 struct dircache_entry *ce;
38 struct dircache_entry *down_entry; 38 struct dircache_entry *down_entry;
39#ifdef SIMULATOR 39#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
40 DIR_UNCACHED *dir, *newdir; 40 DIR_UNCACHED *dir, *newdir;
41 struct dirent_uncached *entry; 41 struct dirent_uncached *entry;
42#else 42#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 @@
26#define MAX_PATH 260 26#define MAX_PATH 260
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include "config.h"
29#include "_ansi.h" 30#include "_ansi.h"
30 31
31#define MAX_OPEN_FILES 11 32#define MAX_OPEN_FILES 11
@@ -49,7 +50,7 @@
49#define O_TRUNC 0x10 50#define O_TRUNC 0x10
50#endif 51#endif
51 52
52#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC) 53#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(PLUGIN) && !defined(CODEC)
53#define open(x, ...) sim_open(x, __VA_ARGS__) 54#define open(x, ...) sim_open(x, __VA_ARGS__)
54#define creat(x,m) sim_creat(x,m) 55#define creat(x,m) sim_creat(x,m)
55#define remove(x) sim_remove(x) 56#define remove(x) sim_remove(x)
@@ -78,7 +79,7 @@ extern int fsync(int fd);
78extern ssize_t read(int fd, void *buf, size_t count); 79extern ssize_t read(int fd, void *buf, size_t count);
79extern off_t lseek(int fildes, off_t offset, int whence); 80extern off_t lseek(int fildes, off_t offset, int whence);
80extern int file_creat(const char *pathname); 81extern int file_creat(const char *pathname);
81#ifndef SIMULATOR 82#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
82/* posix compatibility function */ 83/* posix compatibility function */
83static inline int creat(const char *pathname, mode_t mode) 84static inline int creat(const char *pathname, mode_t mode)
84{ 85{