update bits/setjmp.h for hppa/m68k/mips/s390/sh
Mike Frysinger
vapier@gentoo.org
Wed Nov 16 03:57:00 GMT 2005
simple patch to update bits/setjmp.h for hppa/m68k/mips/s390/sh .. add
normal _BITS_SETJMP_H preprocessors around the whole file and standard
#error check if included by any header other than setjmp.h or pthread.h
-mike
-------------- next part --------------
2005-11-15 Mike Frysinger <vapier@gentoo.org>
* sysdeps/hppa/bits/setjmp.h: Add _BITS_SETJMP_H preprocessor protection
and allow pthread.h to include bits/setjmp.h as well as setjmp.h.
* sysdeps/m68k/bits/setjmp.h: Likewise.
* sysdeps/s390/bits/setjmp.h: Make sure only setjmp.h or pthread.h
are allow to include bits/setjmp.h.
* sysdeps/mips/bits/setjmp.h: Cast jumpbuf to (void*) to match lhs
(void*) cast of address.
* sysdeps/sh/bits/setjmp.h: Likewise.
--- sysdeps/hppa/bits/setjmp.h
+++ sysdeps/hppa/bits/setjmp.h
@@ -17,8 +17,10 @@
02111-1307 USA. */
/* Define the machine-dependent type `jmp_buf'. HPPA version. */
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
-#ifndef _SETJMP_H
+#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
@@ -39,3 +41,5 @@ typedef double __jmp_buf[21];
variable at ADDRESS. */
#define _JMPBUF_UNWINDS(_jmpbuf, _address) \
((void *)(_address) > (void *)(((unsigned long *) _jmpbuf)[JB_SP]))
+
+#endif /* bits/setjmp.h */
--- sysdeps/m68k/bits/setjmp.h
+++ sysdeps/m68k/bits/setjmp.h
@@ -17,8 +17,10 @@
02111-1307 USA. */
/* Define the machine-dependent type `jmp_buf'. m68k version. */
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
-#ifndef _SETJMP_H
+#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
@@ -44,3 +46,5 @@ typedef struct
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((void *) (address) < (void *) (jmpbuf)->__sp)
+
+#endif /* bits/setjmp.h */
--- sysdeps/s390/bits/setjmp.h
+++ sysdeps/s390/bits/setjmp.h
@@ -21,6 +21,10 @@
#ifndef __S390_SETJMP_H__
#define __S390_SETJMP_H__
+#if !defined _SETJMP_H && !defined _PTHREAD_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
#include <bits/wordsize.h>
#define __JB_GPR6 0
--- sysdeps/mips/bits/setjmp.h
+++ sysdeps/mips/bits/setjmp.h
@@ -81,6 +81,6 @@ typedef struct
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (jmpbuf)[0].__sp)
+ ((void *) (address) < (void *) (jmpbuf)[0].__sp)
#endif /* _MIPS_BITS_SETJMP_H */
--- sysdeps/sh/bits/setjmp.h
+++ sysdeps/sh/bits/setjmp.h
@@ -51,6 +51,6 @@ typedef struct
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < &(jmpbuf)[0].__regs[7])
+ ((void *) (address) < (void *) &(jmpbuf)[0].__regs[7])
#endif /* bits/setjmp.h */
More information about the Libc-alpha
mailing list