This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 231324e739e6ebb885e715e8ac8033e0ba54e8ee
Author: liaoao <[email protected]>
AuthorDate: Thu Dec 25 16:34:23 2025 +0800

    signal: guard the sigev_notify macros with CONFIG_SIG_EVTHREAD
    
    The _sigev_un._sigev_thread member only exists when CONFIG_SIG_EVTHREAD
    is selected, but the sigev_notify_function and sigev_notify_attributes
    macros that dereference it are defined unconditionally.  Guard them so
    configurations without SIG_EVTHREAD do not hit a build error when the
    macros are used.
    
    Signed-off-by: liaoao <[email protected]>
    Signed-off-by: zhangyuan29 <[email protected]>
---
 include/signal.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/signal.h b/include/signal.h
index ba7b13f99aa..3a1ab3122bf 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -369,9 +369,12 @@ typedef struct sigevent
     } _sigev_un;
 } sigevent_t;
 
-#define sigev_notify_function   _sigev_un._sigev_thread._function
-#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
-#define sigev_notify_thread_id  _sigev_un._tid
+#ifdef CONFIG_SIG_EVTHREAD
+#  define sigev_notify_function   _sigev_un._sigev_thread._function
+#  define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+#endif
+
+#define sigev_notify_thread_id    _sigev_un._tid
 
 /* The following types is used to pass parameters to/from signal handlers */
 

Reply via email to