summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2022-11-22 22:06:08 -0500
committerMan, Jianting (Meco) <[email protected]>2022-11-22 22:18:26 -0500
commit3e2beebe43dc117728de9b2b1129e3452a990668 (patch)
treee76d16260bce3bac929113d0de1a644e2ccf84bd /components/libc/compilers/common
parentbdd663a33fb0af8864344a7bf568a706669d96d4 (diff)
[libc][musl]解决signal.h报错的问题
Diffstat (limited to 'components/libc/compilers/common')
-rw-r--r--components/libc/compilers/common/include/sys/signal.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/components/libc/compilers/common/include/sys/signal.h b/components/libc/compilers/common/include/sys/signal.h
index b92276ecb1..1a3b9c1beb 100644
--- a/components/libc/compilers/common/include/sys/signal.h
+++ b/components/libc/compilers/common/include/sys/signal.h
@@ -139,8 +139,6 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
#define SIGRTMAX 31
#define NSIG 32
-#include <signal.h>
-
#elif defined(__IAR_SYSTEMS_ICC__)
#define SIGHUP 1
#define SIGINT 2
@@ -175,8 +173,6 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
#define SIGRTMAX 31
#define NSIG 32
-#include <signal.h>
-
#elif defined(__GNUC__)
#define SIGHUP 1 /* hangup */
#define SIGINT 2 /* interrupt */
@@ -213,13 +209,25 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
#define SIGUSR1 30 /* user defined signal 1 */
#define SIGUSR2 31 /* user defined signal 2 */
#define NSIG 32 /* signal 0 implied */
+#endif /* __ARMCC_VERSION */
-#if defined(RT_USING_NEWLIBC)
+#ifndef RT_USING_MUSLLIBC
/* Some applications take advantage of the fact that <sys/signal.h>
* and <signal.h> are equivalent in glibc. Allow for that here. */
#include <signal.h>
-#endif /* defined(RT_USING_NEWLIBC) */
-#endif /* __ARMCC_VERSION */
+#endif /* RT_USING_MUSLLIBC */
+
+#ifndef SIG_ERR
+#define SIG_ERR ((void (*)(int))-1)
+#endif
+
+#ifndef SIG_DFL
+#define SIG_DFL ((void (*)(int)) 0)
+#endif
+
+#ifndef SIG_IGN
+#define SIG_IGN ((void (*)(int)) 1)
+#endif
#ifdef __cplusplus
}