This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Check __x86_64__ instead of __WORDSIZE in bits/setjmp.h
On Mon, Mar 19, 2012 at 4:07 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> > We need to be very sure this cannot perturb anyone's ABI,
>> > e.g. mangled names and the like.
>> >
>> > I'm not aware of any such issue with __jmp_buf in particular, but
>> > we must be circumspect.
>
> The patch looks OK now as far as nits go. ?But I want to let some other
> people give opinions about the safety vs name mangling et al.
>
How about this patch? It defines
typedef long long int __jmp_buf[8];
only for x86-64 with __WORDSIZE != 64.
Thanks.
--
H.J.
2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/x86_64/bits/setjmp.h (__jmp_buf): Support x86-64 with
__WORDSIZE != 64.
diff --git a/sysdeps/x86_64/bits/setjmp.h b/sysdeps/x86_64/bits/setjmp.h
index a66ca0f..bb6920d 100644
--- a/sysdeps/x86_64/bits/setjmp.h
+++ b/sysdeps/x86_64/bits/setjmp.h
@@ -29,6 +29,8 @@
# if __WORDSIZE == 64
typedef long int __jmp_buf[8];
+# elif defined __x86_64__
+typedef long long int __jmp_buf[8];
# else
typedef int __jmp_buf[6];
# endif