请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
部件号:CC3220
工具/软件:TI C/C++编译器
TI ARM编译器是否不支持strnlen? 我已包含string.h,但我在其中未看到列出的函数,我收到一个错误,表示它无法找到它。
此致,Blake
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
部件号:CC3220
工具/软件:TI C/C++编译器
TI ARM编译器是否不支持strnlen? 我已包含string.h,但我在其中未看到列出的函数,我收到一个错误,表示它无法找到它。
此致,Blake
我发现一个似乎有效的实施。 我做了一些轻微的修改,并将其放在platform_config标题中,这样,如果编译器没有strnlen,我就可以添加一个预定义符号(MY_STRNLEN)
#ifdef my_STRNLEN
static inline size_t strnlen (const char *string, size_t length)
{
char *ret = memchr (字符串,0,长度);
返回台? RET - string : length;
}
#endif