diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-05-06 21:04:40 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-05-06 21:04:40 +0000 |
commit | 50a6ca39ad4ed01922aa4f755f0ca579788226cf (patch) | |
tree | c7881b015b220558167310345b162324c96be15a /apps/codecs/lib | |
parent | adb506df14aded06ed6e9ebf8540e6fd383ffd6a (diff) | |
download | rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.gz rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.zip |
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/codecs/lib')
-rw-r--r-- | apps/codecs/lib/codeclib.h | 10 | ||||
-rw-r--r-- | apps/codecs/lib/tlsf/src/tlsf.c | 2 | ||||
-rw-r--r-- | apps/codecs/lib/tlsf/src/tlsf.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h index 817d86a6a3..b7685ebbcb 100644 --- a/apps/codecs/lib/codeclib.h +++ b/apps/codecs/lib/codeclib.h | |||
@@ -22,9 +22,10 @@ | |||
22 | #ifndef __CODECLIB_H__ | 22 | #ifndef __CODECLIB_H__ |
23 | #define __CODECLIB_H__ | 23 | #define __CODECLIB_H__ |
24 | 24 | ||
25 | #include <inttypes.h> | ||
26 | #include <string.h> | ||
25 | #include "config.h" | 27 | #include "config.h" |
26 | #include "codecs.h" | 28 | #include "codecs.h" |
27 | #include <sys/types.h> | ||
28 | #include "mdct.h" | 29 | #include "mdct.h" |
29 | #include "fft.h" | 30 | #include "fft.h" |
30 | 31 | ||
@@ -44,6 +45,7 @@ extern unsigned char* filebuf; /* The rest of the MP3 buffer | |||
44 | #define calloc(x,y) codec_calloc(x,y) | 45 | #define calloc(x,y) codec_calloc(x,y) |
45 | #define realloc(x,y) codec_realloc(x,y) | 46 | #define realloc(x,y) codec_realloc(x,y) |
46 | #define free(x) codec_free(x) | 47 | #define free(x) codec_free(x) |
48 | #undef alloca | ||
47 | #define alloca(x) __builtin_alloca(x) | 49 | #define alloca(x) __builtin_alloca(x) |
48 | 50 | ||
49 | void* codec_malloc(size_t size); | 51 | void* codec_malloc(size_t size); |
@@ -59,7 +61,11 @@ void *memmove(void *s1, const void *s2, size_t n); | |||
59 | size_t strlen(const char *s); | 61 | size_t strlen(const char *s); |
60 | char *strcpy(char *dest, const char *src); | 62 | char *strcpy(char *dest, const char *src); |
61 | char *strcat(char *dest, const char *src); | 63 | char *strcat(char *dest, const char *src); |
62 | int strcmp(const char *, const char *); | 64 | |
65 | /* on some platforms strcmp() seems to be a tricky define which | ||
66 | * breaks if we write down strcmp's prototype */ | ||
67 | #undef strcmp | ||
68 | int strcmp(const char *s1, const char *s2); | ||
63 | 69 | ||
64 | void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); | 70 | void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); |
65 | 71 | ||
diff --git a/apps/codecs/lib/tlsf/src/tlsf.c b/apps/codecs/lib/tlsf/src/tlsf.c index 6d15c3a3f6..570e472607 100644 --- a/apps/codecs/lib/tlsf/src/tlsf.c +++ b/apps/codecs/lib/tlsf/src/tlsf.c | |||
@@ -165,7 +165,7 @@ | |||
165 | #endif | 165 | #endif |
166 | 166 | ||
167 | #if defined(ROCKBOX) && defined(SIMULATOR) || !defined(ROCKBOX) | 167 | #if defined(ROCKBOX) && defined(SIMULATOR) || !defined(ROCKBOX) |
168 | int printf(char*, ...); | 168 | int printf(const char* fmt, ...); |
169 | #define PRINT_MSG(fmt, args...) printf(fmt, ## args) | 169 | #define PRINT_MSG(fmt, args...) printf(fmt, ## args) |
170 | #define ERROR_MSG(fmt, args...) printf(fmt, ## args) | 170 | #define ERROR_MSG(fmt, args...) printf(fmt, ## args) |
171 | #else | 171 | #else |
diff --git a/apps/codecs/lib/tlsf/src/tlsf.h b/apps/codecs/lib/tlsf/src/tlsf.h index 5d016f4369..4feb5c42cc 100644 --- a/apps/codecs/lib/tlsf/src/tlsf.h +++ b/apps/codecs/lib/tlsf/src/tlsf.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #ifndef _TLSF_H_ | 19 | #ifndef _TLSF_H_ |
20 | #define _TLSF_H_ | 20 | #define _TLSF_H_ |
21 | 21 | ||
22 | #include <sys/types.h> | 22 | #include <string.h> /* defines size_t */ |
23 | 23 | ||
24 | extern size_t init_memory_pool(size_t, void *); | 24 | extern size_t init_memory_pool(size_t, void *); |
25 | extern size_t get_used_size(void *); | 25 | extern size_t get_used_size(void *); |