From b3f1871bc3d478e0339fa326dff6bfae67dc0525 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Wed, 14 Aug 2024 11:52:59 +0800 Subject: [PATCH] sched:fix windows sim build error nuttx\sched\signal\sig_timedwait.c(253,13): error C2059: syntax error:'' nuttx\sched\signal\sig_timedwait.c(321,44): error C2182: '$S1': illegal use of type 'void' nuttx\sched\signal\sig_timedwait.c(321,50): error C2059: syntax error:':' nuttx\sched\tls\tls_initinfo.c(68,39): error C2036: 'void *': unknown size nuttx\sched\sched\sched_get_tls.c(76,44): error C2036: 'void *': unkown size Signed-off-by: xuxin19 --- sched/sched/sched_get_tls.c | 3 ++- sched/signal/sig_timedwait.c | 4 ++-- sched/tls/tls_initinfo.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sched/sched/sched_get_tls.c b/sched/sched/sched_get_tls.c index 63517429ed..02b64e61e8 100644 --- a/sched/sched/sched_get_tls.c +++ b/sched/sched/sched_get_tls.c @@ -73,5 +73,6 @@ FAR char **nxsched_get_stackargs(FAR struct tcb_s *tcb) { /* The args data follows the TLS data */ - return (FAR char**)(tcb->stack_alloc_ptr + nxsched_get_tls(tcb)->tl_size); + return (FAR char**)((FAR char *)tcb->stack_alloc_ptr + + nxsched_get_tls(tcb)->tl_size); } diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c index 1b7985deeb..a831dd17a4 100644 --- a/sched/signal/sig_timedwait.c +++ b/sched/signal/sig_timedwait.c @@ -250,7 +250,7 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info, irqstate_t flags; sclock_t waitticks; bool switch_needed; - siginfo_t sinfo; + siginfo_t unbinfo; int ret; DEBUGASSERT(set != NULL); @@ -318,7 +318,7 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info, } #endif - rtcb->sigunbinfo = (info == NULL) ? &sinfo : info; + rtcb->sigunbinfo = (info == NULL) ? &unbinfo : info; /* Check if we should wait for the timeout */ diff --git a/sched/tls/tls_initinfo.c b/sched/tls/tls_initinfo.c index 67792004e4..306f00bbc3 100644 --- a/sched/tls/tls_initinfo.c +++ b/sched/tls/tls_initinfo.c @@ -65,7 +65,8 @@ int tls_init_info(FAR struct tcb_s *tcb) /* Derive tl_size w/o arch knowledge */ - info->tl_size = tcb->stack_base_ptr - tcb->stack_alloc_ptr; + info->tl_size = + (FAR char *)tcb->stack_base_ptr - (FAR char *)tcb->stack_alloc_ptr; /* Attach per-task info in group to TLS */