From 99a1c36f0287de1e185f30d9d9e9760bfeb1dfd5 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 4 Jun 2022 21:52:21 -0400 Subject: [PATCH] attach: remove strnlen #6026 --- include/rtthread.h | 1 + src/kservice.c | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/rtthread.h b/include/rtthread.h index 233d9198c6..fa72384a1d 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -16,6 +16,7 @@ * 2018-11-22 Jesven add all cpu's lock and ipi handler * 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB * 2021-11-14 Meco Man add rtlegacy.h for compatibility + * 2022-06-04 Meco Man remove strnlen */ #ifndef __RT_THREAD_H__ diff --git a/src/kservice.c b/src/kservice.c index f1df8a179d..e8c53bd2ea 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -20,6 +20,7 @@ * 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB * 2021-12-20 Meco Man implement rt_strcpy() * 2022-01-07 Gabriel add __on_rt_assert_hook + * 2022-06-04 Meco Man remove strnlen */ #include @@ -553,7 +554,6 @@ RTM_EXPORT(rt_strlen); #endif /* RT_KSERVICE_USING_STDLIB */ -#if !defined(RT_KSERVICE_USING_STDLIB) || defined(__ARMCC_VERSION) /** * The strnlen() function returns the number of characters in the * string pointed to by s, excluding the terminating null byte ('\0'), @@ -577,10 +577,6 @@ rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen) return sc - s; } RTM_EXPORT(rt_strnlen); -#ifdef __ARMCC_VERSION -rt_size_t strnlen(const char *s, rt_size_t maxlen) __attribute__((alias("rt_strnlen"))); -#endif /* __ARMCC_VERSION */ -#endif /* !defined(RT_KSERVICE_USING_STDLIB) || defined(__ARMCC_VERSION) */ #ifdef RT_USING_HEAP /** @@ -603,9 +599,6 @@ char *rt_strdup(const char *s) return tmp; } RTM_EXPORT(rt_strdup); -#ifdef __ARMCC_VERSION -char *strdup(const char *s) __attribute__((alias("rt_strdup"))); -#endif /* __ARMCC_VERSION */ #endif /* RT_USING_HEAP */ /**