Skip to content

Commit 919d7bb

Browse files
committed
[picolibc] fix the errno declaration conflict
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:13:5: error: conflicting types for 'pico_get_errno' int pico_get_errno(void) ^ /opt/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64/bin/../lib/clang-runtimes/arm-none-eabi/armv7em_hard_fpv4_sp_d16/include/sys/errno.h:59:6: note: previous declaration is here int *__PICOLIBC_ERRNO_FUNCTION(void);
1 parent 6064079 commit 919d7bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

components/libc/compilers/picolibc/syscall.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010

1111
#include <rtthread.h>
1212

13-
int pico_get_errno(void)
13+
int *pico_get_errno(void)
1414
{
15-
return rt_get_errno();
15+
rt_thread_t tid = RT_NULL;
16+
17+
tid = rt_thread_self();
18+
if (tid)
19+
{
20+
return &tid->error;
21+
}
22+
23+
return RT_NULL;
1624
}
1725

1826
#ifdef RT_USING_HEAP /* Memory routine */

0 commit comments

Comments
 (0)