From 50a6ca39ad4ed01922aa4f755f0ca579788226cf Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 6 May 2010 21:04:40 +0000 Subject: Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/doom/d_deh.c | 2 +- apps/plugins/doom/doom.make | 2 +- apps/plugins/doom/rockmacros.h | 20 +++++++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'apps/plugins/doom') diff --git a/apps/plugins/doom/d_deh.c b/apps/plugins/doom/d_deh.c index d3f7496885..82426c1bab 100644 --- a/apps/plugins/doom/d_deh.c +++ b/apps/plugins/doom/d_deh.c @@ -44,7 +44,7 @@ #include "d_think.h" #include "w_wad.h" -#include "sscanf.h" +#include /* sscanf */ #include "rockmacros.h" #define TRUE 1 diff --git a/apps/plugins/doom/doom.make b/apps/plugins/doom/doom.make index bdc32230eb..54a63eb707 100644 --- a/apps/plugins/doom/doom.make +++ b/apps/plugins/doom/doom.make @@ -13,7 +13,7 @@ DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom ROCKS += $(DOOMBUILDDIR)/doom.rock DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES) -DOOM_SRC += $(ROOTDIR)/firmware/common/sscanf.c +DOOM_SRC += $(ROOTDIR)/firmware/libc/sscanf.c DOOM_OBJ := $(call c2obj, $(DOOM_SRC)) # add source files to OTHER_SRC to get automatic dependencies diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h index e066fe861c..89c943622a 100644 --- a/apps/plugins/doom/rockmacros.h +++ b/apps/plugins/doom/rockmacros.h @@ -33,9 +33,13 @@ extern bool doomexit; int printf(const char *fmt, ...); int fileexists(const char * fname); char *my_strtok( char * s, const char * delim ); +#undef alloca #define alloca __builtin_alloca -#define fdprintf(...) rb->fdprintf(__VA_ARGS__) +#undef fdprintf +#define fdprintf(...) rb->fdprintf(__VA_ARGS__) +#undef vsnprintf #define vsnprintf(...) rb->vsnprintf(__VA_ARGS__) +#undef read_line #define read_line(a,b,c) rb->read_line((a),(b),(c)) #ifdef SIMULATOR @@ -52,19 +56,33 @@ int my_close(int id); #define filesize(a) rb->filesize((a)) #define read(a,b,c) rb->read((a),(b),(c)) #define write(a,b,c) rb->write((a),(b),(c)) +#undef strtok #define strtok(a,b) my_strtok((a),(b)) +#undef strcat #define strcat(a,b) rb->strcat((a),(b)) +#undef memset #define memset(a,b,c) rb->memset((a),(b),(c)) +#undef memmove #define memmove(a,b,c) rb->memmove((a),(b),(c)) +#undef memcmp #define memcmp(a,b,c) rb->memcmp((a),(b),(c)) +#undef memchr #define memchr(a,b,c) rb->memchr((a),(b),(c)) +#undef strcpy #define strcpy(a,b) rb->strcpy((a),(b)) +#undef strlen #define strlen(a) rb->strlen((a)) +#undef strcmp #define strcmp(a,b) rb->strcmp((a),(b)) +#undef strncmp #define strncmp(a,b,c) rb->strncmp((a),(b),(c)) +#undef strchr #define strchr(a,b) rb->strchr((a),(b)) +#undef strrchr #define strrchr(a,b) rb->strrchr((a),(b)) +#undef strcasecmp #define strcasecmp(a,b) rb->strcasecmp((a),(b)) +#undef strncasecmp #define strncasecmp(a,b,c) rb->strncasecmp((a),(b),(c)) #define srand(a) rb->srand((a)) #define rand() rb->rand() -- cgit v1.2.3