From c6d20104eb1ba2beae266dff7eba655b9ab9576e Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 3 Mar 2012 18:54:47 +0100 Subject: Fix __PCTOOL__ dependencies on SIMULATOR * filesize() is not POSIX, so it doesn't need stubbing or redirecting * make the various directory functions use the sim_ versions for PCTOOL * PCTOOL needs generic byteswap functions * fix the database makefile to not use -DSIMULATOR anymore Change-Id: Ic6abc4f662830b85626c751a472fa4a03e844871 --- firmware/export/system.h | 2 ++ firmware/include/dir_uncached.h | 2 +- firmware/include/file.h | 2 -- tools/database/database.make | 2 +- uisimulator/common/io.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/firmware/export/system.h b/firmware/export/system.h index d34ff995f7..b33edc6d3e 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -191,6 +191,8 @@ enum { #elif defined(HAVE_SDL) /* SDL build */ #include "system-sdl.h" #define NEED_GENERIC_BYTESWAPS +#elif defined(__PCTOOL__) +#define NEED_GENERIC_BYTESWAPS #endif #include "bitswap.h" diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h index 85f371f972..017b86cc39 100644 --- a/firmware/include/dir_uncached.h +++ b/firmware/include/dir_uncached.h @@ -33,7 +33,7 @@ struct dirinfo { #include #include "file.h" -#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) || defined(__PCTOOL__) # define dirent_uncached sim_dirent # define DIR_UNCACHED SIM_DIR # define opendir_uncached sim_opendir diff --git a/firmware/include/file.h b/firmware/include/file.h index ac856edb8c..198fccbc7b 100644 --- a/firmware/include/file.h +++ b/firmware/include/file.h @@ -47,7 +47,6 @@ extern int app_creat(const char *name, mode_t mode); extern int app_remove(const char* pathname); extern int app_rename(const char* path, const char* newname); # if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) -# define filesize(x) sim_filesize(x) # define fsync(x) sim_fsync(x) # define ftruncate(x,y) sim_ftruncate(x,y) # define lseek(x,y,z) sim_lseek(x,y,z) @@ -60,7 +59,6 @@ extern int app_rename(const char* path, const char* newname); # define creat(x,m) sim_creat(x,m) # define remove(x) sim_remove(x) # define rename(x,y) sim_rename(x,y) -# define filesize(x) sim_filesize(x) # define fsync(x) sim_fsync(x) # define ftruncate(x,y) sim_ftruncate(x,y) # define lseek(x,y,z) sim_lseek(x,y,z) diff --git a/tools/database/database.make b/tools/database/database.make index 920acebd5d..7d02a461bd 100644 --- a/tools/database/database.make +++ b/tools/database/database.make @@ -7,7 +7,7 @@ # $Id: checkwps.make 22680 2009-09-11 17:58:17Z gevaerts $ # -DBDEFINES=-g -DDEBUG -D__PCTOOL__ -DSIMULATOR +DBDEFINES=-g -DDEBUG -D__PCTOOL__ CFLAGS+=$(DBDEFINES) createsrc = $(shell cat $(1) > $(3); echo "\#if CONFIG_CODEC == SWCODEC" >> $(3); \ diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 1df36d3b34..6f9f4b2945 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c @@ -517,7 +517,7 @@ long sim_lseek(int fildes, long offset, int whence) return lseek(fildes, offset, whence); } -long sim_filesize(int fd) +long filesize(int fd) { #ifdef WIN32 return _filelength(fd); -- cgit v1.2.3