From a05a278552bfbdc67dd026be8a748c627b57d0c4 Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 12 Feb 2016 07:38:19 +0000 Subject: POSIX states that #include shall make both mcontext_t and ucontext_t available. Our code even has XXX comment about this. Add a bit of compliance by moving struct __ucontext definition into sys/_ucontext.h and including it into signal.h and sys/ucontext.h. Several machine/ucontext.h headers were changed to use namespace-safe types (like uint64_t->__uint64_t) to not depend on sys/types.h. struct __stack_t from sys/signal.h is made always visible in private namespace to satisfy sys/_ucontext.h requirements. Apparently mips _types.h pollutes global namespace with f_register_t type definition. This commit does not try to fix the issue. PR: 207079 Reported and tested by: Ting-Wei Lan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- include/signal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/signal.h b/include/signal.h index 895ccc3..33be55c 100644 --- a/include/signal.h +++ b/include/signal.h @@ -36,6 +36,8 @@ #include #include #include +#include +#include #if __BSD_VISIBLE /* @@ -114,7 +116,6 @@ void psignal(unsigned int, const char *); #if __BSD_VISIBLE int sigblock(int); -struct __ucontext; /* XXX spec requires a complete declaration. */ int sigreturn(const struct __ucontext *); int sigsetmask(int); int sigstack(const struct sigstack *, struct sigstack *); -- cgit v1.1 From 3275ec640958983e0a6f3979276b4be3b1cf8e15 Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 13 Feb 2016 17:23:55 +0000 Subject: Hide ucontext_t and mcontext_t when neither POSIX nor XSI features are enabled in the compilation environment, i.e. for ANSI C use of #include . Requested and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 13 days --- include/signal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/signal.h b/include/signal.h index 33be55c..217fadd 100644 --- a/include/signal.h +++ b/include/signal.h @@ -36,8 +36,10 @@ #include #include #include +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #include #include +#endif #if __BSD_VISIBLE /* -- cgit v1.1