Fix namespace issues by using visibility conditionals from

<sys/cdefs.h>.
This commit is contained in:
Mike Barcroft 2002-10-05 05:47:56 +00:00
parent 229aeecbbf
commit e61d3b10d7
6 changed files with 40 additions and 10 deletions

View File

@ -35,6 +35,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
#include <sys/cdefs.h>
#define _JBLEN 81 /* Size, in longs, of a jmp_buf. */
/*
@ -42,7 +44,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif

View File

@ -35,6 +35,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
#include <sys/cdefs.h>
#define _JBLEN 11 /* Size of the jmp_buf on x86. */
/*
@ -42,7 +44,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif

View File

@ -35,6 +35,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
#include <sys/cdefs.h>
#define _JBLEN 11 /* Size of the jmp_buf on x86. */
/*
@ -42,7 +44,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif

View File

@ -42,6 +42,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
#include <sys/cdefs.h>
/*
* IA64 assembler doesn't like C style comments. This also means we can't
* include other include files to get things like the roundup2() macro.
@ -52,9 +54,14 @@
* of an individual item saved in jmp_buf.
*/
#if __BSD_VISIBLE
#define our_roundup(x, y) (((x)+((y)-1))&(~((y)-1)))
#endif
#define JMPBUF_ALIGNMENT 0x10
#define _JMPBUF_ALIGNMENT 0x10
#if __BSD_VISIBLE
#define JMPBUF_ALIGNMENT _JMPBUF_ALIGNMENT
#define JMPBUF_ADDR_OF(buf, item) \
((size_t)((our_roundup((size_t)buf, JMPBUF_ALIGNMENT)) + item))
@ -100,22 +107,35 @@
#define J_SIG0 0x1d8
#define J_SIG1 0x1e0
#define J_SIGMASK 0x1e8
#define J_END 0x1f0
#endif /* __BSD_VISIBLE */
#define _J_END 0x1f0
#if __BSD_VISIBLE
#define J_END _J_END
#endif
/*
* XXX this check is wrong, since LOCORE is in the application namespace and
* applications shouldn't be able to affect the implementation. One workaround
* would be to only check LOCORE if _KERNEL is defined, but unfortunately
* LOCORE is used outside of the kernel. The best solution would be to rename
* LOCORE to _LOCORE, so that it can be used in userland to safely affect the
* implementation.
*/
#ifndef LOCORE
/*
* jmp_buf and sigjmp_buf are encapsulated in different structs to force
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf {
char Buffer[J_END + JMPBUF_ALIGNMENT];
char _Buffer[_J_END + _JMPBUF_ALIGNMENT];
} sigjmp_buf[1];
#endif
typedef struct _jmp_buf {
char Buffer[J_END + JMPBUF_ALIGNMENT];
char _Buffer[ _J_END + _JMPBUF_ALIGNMENT ];
} jmp_buf[1];
#endif

View File

@ -6,6 +6,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
#include <sys/cdefs.h>
#define _JBLEN 100
/*
@ -13,7 +15,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif

View File

@ -36,6 +36,8 @@
#ifndef _MACHINE_SETJMP_H_
#define _MACHINE_SETJMP_H_
#include <sys/cdefs.h>
#define _JBLEN 5
#define _JB_FP 0
@ -49,7 +51,7 @@
* compile-time diagnostics for mismatches. The structs are the same
* internally to avoid some run-time errors for mismatches.
*/
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1];
#endif