[libc] remove strdup from rtthread.h (#6026)
add __STDC_LIMIT_MACROS macro in Keil add RT_USING_LIBC in simulator add _DLIB_ADD_EXTRA_SYMBOLS=0 in IAR
This commit is contained in:
parent
02b176f8cb
commit
fb3f835089
|
@ -8,7 +8,7 @@ src = ['board.c', 'uart_console.c']
|
|||
LIBS = []
|
||||
LIBPATH = []
|
||||
CPPPATH = [cwd]
|
||||
CPPDEFINES = []
|
||||
CPPDEFINES = ['RT_USING_LIBC']
|
||||
|
||||
if rtconfig.CROSS_TOOL == 'msvc':
|
||||
CPPDEFINES += \
|
||||
|
|
|
@ -4,7 +4,7 @@ Import('rtconfig')
|
|||
src = Glob('*.c')
|
||||
group = []
|
||||
|
||||
CPPDEFINES = ['RT_USING_ARM_LIBC', 'RT_USING_LIBC']
|
||||
CPPDEFINES = ['RT_USING_ARM_LIBC', 'RT_USING_LIBC', '__STDC_LIMIT_MACROS']
|
||||
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
group = DefineGroup('Compiler', src, depend = [''], CPPDEFINES = CPPDEFINES)
|
||||
|
|
|
@ -4,7 +4,7 @@ Import('rtconfig')
|
|||
src = Glob('*.c')
|
||||
group = []
|
||||
|
||||
CPPDEFINES = ['RT_USING_DLIBC', 'RT_USING_LIBC']
|
||||
CPPDEFINES = ['RT_USING_DLIBC', 'RT_USING_LIBC', '_DLIB_ADD_EXTRA_SYMBOLS=0']
|
||||
|
||||
if rtconfig.PLATFORM == 'iar':
|
||||
if GetDepend('DFS_USING_POSIX'):
|
||||
|
|
|
@ -605,7 +605,8 @@ void *rt_memcpy(void *dest, const void *src, rt_ubase_t n);
|
|||
void *rt_memmove(void *dest, const void *src, rt_size_t n);
|
||||
rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_size_t count);
|
||||
#endif /* RT_KSERVICE_USING_STDLIB_MEMORY */
|
||||
|
||||
char *rt_strdup(const char *s);
|
||||
rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen);
|
||||
#ifndef RT_KSERVICE_USING_STDLIB
|
||||
char *rt_strstr(const char *str1, const char *str2);
|
||||
rt_int32_t rt_strcasecmp(const char *a, const char *b);
|
||||
|
@ -631,19 +632,6 @@ rt_size_t rt_strlen(const char *src);
|
|||
#define rt_strlen(src) strlen(src)
|
||||
#endif /*RT_KSERVICE_USING_STDLIB*/
|
||||
|
||||
char *rt_strdup(const char *s);
|
||||
|
||||
#if !defined(RT_KSERVICE_USING_STDLIB) || defined(__ARMCC_VERSION)
|
||||
rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen);
|
||||
#else
|
||||
#define rt_strnlen(s, maxlen) strnlen(s, maxlen)
|
||||
#endif /* !defined(RT_KSERVICE_USING_STDLIB) || defined(__ARMCC_VERSION) */
|
||||
|
||||
#ifdef __ARMCC_VERSION
|
||||
/* MDK doesn't have these APIs */
|
||||
rt_size_t strnlen(const char *s, rt_size_t maxlen);
|
||||
#endif /* __ARMCC_VERSION */
|
||||
|
||||
void rt_show_version(void);
|
||||
|
||||
#ifdef RT_DEBUG
|
||||
|
|
Loading…
Reference in New Issue