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/zxbox/helpers.h | 7 +++++-- apps/plugins/zxbox/snapshot.c | 8 ++++---- apps/plugins/zxbox/spconf.c | 8 ++++---- apps/plugins/zxbox/sptape.c | 1 - apps/plugins/zxbox/tapefile.c | 2 +- apps/plugins/zxbox/zxmisc.h | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) (limited to 'apps/plugins/zxbox') diff --git a/apps/plugins/zxbox/helpers.h b/apps/plugins/zxbox/helpers.h index ba8607d5cb..c8cb9c1554 100644 --- a/apps/plugins/zxbox/helpers.h +++ b/apps/plugins/zxbox/helpers.h @@ -7,9 +7,12 @@ extern off_t my_ftell(int); extern void *my_malloc(size_t size); +#undef getc #define getc my_getc -#define malloc my_malloc -#define ftell my_ftell +#undef putc #define putc my_putc +#undef ftell +#define ftell my_ftell +#define malloc my_malloc #endif /* HELPERS_H */ diff --git a/apps/plugins/zxbox/snapshot.c b/apps/plugins/zxbox/snapshot.c index 0b80b64497..468f46667e 100644 --- a/apps/plugins/zxbox/snapshot.c +++ b/apps/plugins/zxbox/snapshot.c @@ -18,8 +18,9 @@ * */ +#include +#include /* size_t */ #include "zxmisc.h" -#include "helpers.h" #include "spperif.h" #include "z80.h" @@ -29,9 +30,8 @@ #include "spconf.h" -#include -#include -#include +/* include this at last to avoid clashes with stdio functions */ +#include "helpers.h" #define COMPRESS_SAVE 1 diff --git a/apps/plugins/zxbox/spconf.c b/apps/plugins/zxbox/spconf.c index 728f78638c..0daabc7d77 100644 --- a/apps/plugins/zxbox/spconf.c +++ b/apps/plugins/zxbox/spconf.c @@ -17,6 +17,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +#include +#include +#include #include "zxmisc.h" #include "spconf_p.h" #include "interf.h" @@ -26,11 +30,7 @@ #include "snapshot.h" /* for SN_Z80 and SN_SNA */ #include "tapefile.h" /* for TAP_TAP and TAP_TZX */ #include "zxconfig.h" -#include "stdio.h" -#include "string.h" -#include "sys/types.h" #include "helpers.h" -#include "ctype.h" extern const char *spcf_keynames_ascii[]; diff --git a/apps/plugins/zxbox/sptape.c b/apps/plugins/zxbox/sptape.c index 21f962ea28..80921a0afd 100644 --- a/apps/plugins/zxbox/sptape.c +++ b/apps/plugins/zxbox/sptape.c @@ -31,7 +31,6 @@ #include #include #include -#include #define MAXLINELEN 256 diff --git a/apps/plugins/zxbox/tapefile.c b/apps/plugins/zxbox/tapefile.c index 0e262aa0f7..92f4ea69f6 100644 --- a/apps/plugins/zxbox/tapefile.c +++ b/apps/plugins/zxbox/tapefile.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include "inttypes.h" #include "zxconfig.h" #include "helpers.h" #define max(x, y) ((x) > (y) ? (x) : (y)) diff --git a/apps/plugins/zxbox/zxmisc.h b/apps/plugins/zxbox/zxmisc.h index 4ad25a0604..904af24e3d 100644 --- a/apps/plugins/zxbox/zxmisc.h +++ b/apps/plugins/zxbox/zxmisc.h @@ -21,7 +21,7 @@ #ifndef ZXMISC_H #define ZXMISC_H -#include +#include /* size_t */ extern char *get_base_name(char *fname); extern int check_ext(const char *filename, const char *ext); -- cgit v1.2.3