summaryrefslogtreecommitdiff
path: root/apps/codecs.c
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 /apps/codecs.c
parent02e04585bdf1fbd00cf84d2000f59ec198440cb3 (diff)
downloadrockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.zip
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.gz
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.bz2
rockbox-35e8b1429a2cdcf6580f6d25890fed9865165d0b.tar.xz
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 'apps/codecs.c')
-rw-r--r--apps/codecs.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index 46d9223..22e692c 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -54,20 +54,20 @@
#define LOGF_ENABLE
#include "logf.h"
-#ifdef SIMULATOR
-#define PREFIX(_x_) sim_ ## _x_
-#else
-#define PREFIX
-#endif
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
-#ifdef SIMULATOR
+#define PREFIX(_x_) sim_ ## _x_
#if CONFIG_CODEC == SWCODEC
unsigned char codecbuf[CODEC_SIZE];
#endif
void *sim_codec_load_ram(char* codecptr, int size, void **pd);
void sim_codec_close(void *pd);
-#else
+
+#else /* !PLATFORM_HOSTED */
+
+#define PREFIX
#define sim_codec_close(x)
+
#endif
size_t codec_size;
@@ -77,7 +77,7 @@ extern void* plugin_get_audio_buffer(size_t *buffer_size);
#undef open
static int open(const char* pathname, int flags, ...)
{
-#ifdef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
int fd;
if (flags & O_CREAT)
{
@@ -201,7 +201,7 @@ static int codec_load_ram(int size, struct codec_api *api)
{
struct codec_header *hdr;
int status;
-#ifndef SIMULATOR
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
hdr = (struct codec_header *)codecbuf;
if (size <= (signed)sizeof(struct codec_header)
@@ -220,7 +220,7 @@ static int codec_load_ram(int size, struct codec_api *api)
codec_size = hdr->end_addr - codecbuf;
-#else /* SIMULATOR */
+#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
void *pd;
hdr = sim_codec_load_ram(codecbuf, size, &pd);
@@ -241,7 +241,7 @@ static int codec_load_ram(int size, struct codec_api *api)
codec_size = codecbuf - codecbuf;
-#endif /* SIMULATOR */
+#endif /* CONFIG_PLATFORM */
if (hdr->api_version > CODEC_API_VERSION
|| hdr->api_version < CODEC_MIN_API_VERSION) {
sim_codec_close(pd);