[newlib-cygwin] Feature test macros overhaul: signal.h (part 2)

Yaakov Selkowitz yselkowitz@sourceware.org
Fri Mar 18 16:23:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d3f203d091af5f54f4f5c3f6d15a3e03e5aef6c9

commit d3f203d091af5f54f4f5c3f6d15a3e03e5aef6c9
Author: Yaakov Selkowitz <yselkowi@redhat.com>
Date:   Thu Mar 17 23:21:49 2016 -0500

    Feature test macros overhaul: signal.h (part 2)
    
    Move the sig*set macros following the functions inside their feature
    test macro conditional.
    
    This fixes the build on bare-metal targets following
    commit 5c78499ae2ae6ac28854b43a1ad73d917b40c62d.
    
    Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
    Acked-by: Corinna Vinschen <vinschen@redhat.com>

Diff:
---
 newlib/libc/include/sys/signal.h | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h
index d12d42f..d6d173c 100644
--- a/newlib/libc/include/sys/signal.h
+++ b/newlib/libc/include/sys/signal.h
@@ -156,15 +156,6 @@ typedef struct sigaltstack {
 #define SIG_BLOCK 1	/* set of signals to block */
 #define SIG_UNBLOCK 2	/* set of signals to, well, unblock */
 
-/* These depend upon the type of sigset_t, which right now 
-   is always a long.. They're in the POSIX namespace, but
-   are not ANSI. */
-#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
-#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
-#define sigemptyset(what)   (*(what) = 0, 0)
-#define sigfillset(what)    (*(what) = ~(0), 0)
-#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
-
 int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset));
 
 #if defined(_POSIX_THREADS)
@@ -172,12 +163,6 @@ int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset));
 #endif
 
 #if defined(__CYGWIN__) || defined(__rtems__)
-#undef sigaddset
-#undef sigdelset
-#undef sigemptyset
-#undef sigfillset
-#undef sigismember
-
 #ifdef _COMPILING_NEWLIB
 int _EXFUN(_kill, (pid_t, int));
 #endif /* _COMPILING_NEWLIB */
@@ -196,7 +181,18 @@ int _EXFUN(sigemptyset, (sigset_t *));
 int _EXFUN(sigpending, (sigset_t *));
 int _EXFUN(sigsuspend, (const sigset_t *));
 int _EXFUN(sigpause, (int));
-#endif
+
+#if !defined(__CYGWIN__) && !defined(__rtems__)
+/* These depend upon the type of sigset_t, which right now 
+   is always a long.. They're in the POSIX namespace, but
+   are not ANSI. */
+#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
+#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
+#define sigemptyset(what)   (*(what) = 0, 0)
+#define sigfillset(what)    (*(what) = ~(0), 0)
+#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
+#endif /* !__CYGWIN__ && !__rtems__ */
+#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 4 */
 
 #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
 int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict));



More information about the Newlib-cvs mailing list