From 35e8b1429a2cdcf6580f6d25890fed9865165d0b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 21 Jun 2010 16:53:00 +0000 Subject: 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 --- apps/codecs.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'apps/codecs.c') diff --git a/apps/codecs.c b/apps/codecs.c index 46d9223560..22e692c111 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); -- cgit v1.2.3