From 7368b0f850f7d33817f7b90ef510ce0845ccf0b4 Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Sun, 29 Sep 2024 17:23:47 +0800 Subject: [PATCH] sched/signal: Fix compilation errors for MSVC. VELAPLATFO-43345 This commit removed empty struct to fix compilation errors for the MSVC compiler. Change-Id: Iab09ef3eca1f59caa240304602847901e2bca8cf Signed-off-by: ouyangxiangzhen --- include/nuttx/signal.h | 4 +--- sched/timer/timer.h | 2 ++ sched/timer/timer_settime.c | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h index cd52a9d1e0adf..06407c1678be3 100644 --- a/include/nuttx/signal.h +++ b/include/nuttx/signal.h @@ -63,11 +63,9 @@ struct sigwork_s { -#ifdef CONFIG_SIG_EVTHREAD struct work_s work; /* Work queue structure */ union sigval value; /* Data passed with notification */ sigev_notify_function_t func; /* Notification function */ -#endif }; #ifdef __cplusplus @@ -640,7 +638,7 @@ int nxsig_notification(pid_t pid, FAR struct sigevent *event, #ifdef CONFIG_SIG_EVTHREAD void nxsig_cancel_notification(FAR struct sigwork_s *work); #else -# define nxsig_cancel_notification(work) (void)(work) +# define nxsig_cancel_notification(work) #endif #ifdef __cplusplus diff --git a/sched/timer/timer.h b/sched/timer/timer.h index f91bbff2b8d7b..a4e88bb5c32c7 100644 --- a/sched/timer/timer.h +++ b/sched/timer/timer.h @@ -63,7 +63,9 @@ struct posix_timer_s clock_t pt_expected; /* Expected absolute time */ struct wdog_s pt_wdog; /* The watchdog that provides the timing */ struct sigevent pt_event; /* Notification information */ +#ifdef CONFIG_SIG_EVTHREAD struct sigwork_s pt_work; +#endif }; /**************************************************************************** diff --git a/sched/timer/timer_settime.c b/sched/timer/timer_settime.c index 25ddb620c6a2f..47e882ba214bc 100644 --- a/sched/timer/timer_settime.c +++ b/sched/timer/timer_settime.c @@ -72,8 +72,13 @@ static void timer_timeout(wdparm_t itimer); static inline void timer_signotify(FAR struct posix_timer_s *timer) { +#ifdef CONFIG_SIG_EVTHREAD DEBUGVERIFY(nxsig_notification(timer->pt_owner, &timer->pt_event, SI_TIMER, &timer->pt_work)); +#else + DEBUGVERIFY(nxsig_notification(timer->pt_owner, &timer->pt_event, + SI_TIMER, NULL)); +#endif } /****************************************************************************