diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-15 17:53:56 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-15 21:46:19 +0100 |
commit | 16d1788356e82c639302a884437341e039574822 (patch) | |
tree | b075555d7162cc540235cb5b0fd85963e3cde5c0 /lib/rbcodec/codecs/lib/codeclib.h | |
parent | d984725cbf38d0a9e71c866ae61c48ad488373b4 (diff) | |
download | rockbox-16d1788356e82c639302a884437341e039574822.tar.gz rockbox-16d1788356e82c639302a884437341e039574822.zip |
Fix codecs in simulator builds on Windows
The mingw linker uses strlen() in some cases, and codeclib.c redefines it, that
leads to mingw runtime init to call into our strlen() and then ci->strlen() which
of course crashes. Apply the same fix as for malloc and friends: rename the symbol.
The codeclib.h include is necessary for normal builds.
Change-Id: Ifa85901a3e4a31cc0e10b4b905df348a239d5c99
Diffstat (limited to 'lib/rbcodec/codecs/lib/codeclib.h')
-rw-r--r-- | lib/rbcodec/codecs/lib/codeclib.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbcodec/codecs/lib/codeclib.h b/lib/rbcodec/codecs/lib/codeclib.h index 18c1043b8c..6a18870898 100644 --- a/lib/rbcodec/codecs/lib/codeclib.h +++ b/lib/rbcodec/codecs/lib/codeclib.h | |||
@@ -40,6 +40,7 @@ extern struct codec_api *ci; | |||
40 | #define free(x) codec_free(x) | 40 | #define free(x) codec_free(x) |
41 | #undef alloca | 41 | #undef alloca |
42 | #define alloca(x) __builtin_alloca(x) | 42 | #define alloca(x) __builtin_alloca(x) |
43 | #define strlen(s) codec_strlen(s) | ||
43 | 44 | ||
44 | void* codec_malloc(size_t size); | 45 | void* codec_malloc(size_t size); |
45 | void* codec_calloc(size_t nmemb, size_t size); | 46 | void* codec_calloc(size_t nmemb, size_t size); |
@@ -51,7 +52,7 @@ void *memset(void *s, int c, size_t n); | |||
51 | int memcmp(const void *s1, const void *s2, size_t n); | 52 | int memcmp(const void *s1, const void *s2, size_t n); |
52 | void *memmove(void *s1, const void *s2, size_t n); | 53 | void *memmove(void *s1, const void *s2, size_t n); |
53 | 54 | ||
54 | size_t strlen(const char *s); | 55 | size_t codec_strlen(const char *s); |
55 | char *strcpy(char *dest, const char *src); | 56 | char *strcpy(char *dest, const char *src); |
56 | char *strcat(char *dest, const char *src); | 57 | char *strcat(char *dest, const char *src); |
57 | 58 | ||