summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
commit50a6ca39ad4ed01922aa4f755f0ca579788226cf (patch)
treec7881b015b220558167310345b162324c96be15a /apps/plugins/zxbox
parentadb506df14aded06ed6e9ebf8540e6fd383ffd6a (diff)
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
Diffstat (limited to 'apps/plugins/zxbox')
-rw-r--r--apps/plugins/zxbox/helpers.h7
-rw-r--r--apps/plugins/zxbox/snapshot.c8
-rw-r--r--apps/plugins/zxbox/spconf.c8
-rw-r--r--apps/plugins/zxbox/sptape.c1
-rw-r--r--apps/plugins/zxbox/tapefile.c2
-rw-r--r--apps/plugins/zxbox/zxmisc.h2
6 files changed, 15 insertions, 13 deletions
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 <stdlib.h>
+#include <string.h> /* size_t */
#include "zxmisc.h"
-#include "helpers.h"
#include "spperif.h"
#include "z80.h"
@@ -29,9 +30,8 @@
#include "spconf.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
+/* 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 <stdio.h>
+#include <string.h>
+#include <ctype.h>
#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 <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <sys/types.h>
#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 <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <sys/types.h>
+#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 <sys/types.h>
+#include <string.h> /* size_t */
extern char *get_base_name(char *fname);
extern int check_ext(const char *filename, const char *ext);