Skip to content

Commit 99a1c36

Browse files
mysterywolfGuozhanxin
authored andcommitted
attach: remove strnlen #6026
1 parent 37d0be3 commit 99a1c36

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

include/rtthread.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* 2018-11-22 Jesven add all cpu's lock and ipi handler
1717
* 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB
1818
* 2021-11-14 Meco Man add rtlegacy.h for compatibility
19+
* 2022-06-04 Meco Man remove strnlen
1920
*/
2021

2122
#ifndef __RT_THREAD_H__

src/kservice.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB
2121
* 2021-12-20 Meco Man implement rt_strcpy()
2222
* 2022-01-07 Gabriel add __on_rt_assert_hook
23+
* 2022-06-04 Meco Man remove strnlen
2324
*/
2425

2526
#include <rtthread.h>
@@ -553,7 +554,6 @@ RTM_EXPORT(rt_strlen);
553554

554555
#endif /* RT_KSERVICE_USING_STDLIB */
555556

556-
#if !defined(RT_KSERVICE_USING_STDLIB) || defined(__ARMCC_VERSION)
557557
/**
558558
* The strnlen() function returns the number of characters in the
559559
* 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)
577577
return sc - s;
578578
}
579579
RTM_EXPORT(rt_strnlen);
580-
#ifdef __ARMCC_VERSION
581-
rt_size_t strnlen(const char *s, rt_size_t maxlen) __attribute__((alias("rt_strnlen")));
582-
#endif /* __ARMCC_VERSION */
583-
#endif /* !defined(RT_KSERVICE_USING_STDLIB) || defined(__ARMCC_VERSION) */
584580

585581
#ifdef RT_USING_HEAP
586582
/**
@@ -603,9 +599,6 @@ char *rt_strdup(const char *s)
603599
return tmp;
604600
}
605601
RTM_EXPORT(rt_strdup);
606-
#ifdef __ARMCC_VERSION
607-
char *strdup(const char *s) __attribute__((alias("rt_strdup")));
608-
#endif /* __ARMCC_VERSION */
609602
#endif /* RT_USING_HEAP */
610603

611604
/**

0 commit comments

Comments
 (0)