Explorar o código

[libc] including musl signal.h with _POSIX_SOURCE

wangxiaoyao %!s(int64=2) %!d(string=hai) anos
pai
achega
f84d89b0ca
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      components/libc/compilers/common/include/sys/signal.h

+ 10 - 0
components/libc/compilers/common/include/sys/signal.h

@@ -17,7 +17,17 @@ extern "C" {
 #endif /* __cplusplus */
 
 #ifdef RT_USING_MUSLLIBC
+/* this is require for musl <signal.h> */
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE
 #include <signal.h>
+/* limit influenced of _POSIX_SOURCE */
+#undef _POSIX_SOURCE
+
+#else /* ndef _POSIX_SOURCE */
+#include <signal.h>
+#endif
+
 #else
 
 #include <stdint.h>