From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3285 invoked by alias); 1 Sep 2004 20:56:12 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 3267 invoked from network); 1 Sep 2004 20:56:11 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 1 Sep 2004 20:56:11 -0000 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 77DC5B5DF51 for ; Wed, 1 Sep 2004 22:56:11 +0200 (CEST) To: libc-hacker@sources.redhat.com Subject: Re: Fix ia64/sys/ucontext.h =?iso-8859-1?q?f=FCr?= g++ 3.5 References: <20040901172520.GA17065@twiddle.net> From: Andreas Schwab X-Yow: Let me do my TRIBUTE to FISHNET STOCKINGS... Date: Wed, 01 Sep 2004 20:56:00 -0000 In-Reply-To: <20040901172520.GA17065@twiddle.net> (Richard Henderson's message of "Wed, 1 Sep 2004 10:25:20 -0700") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-09/txt/msg00004.txt.bz2 Richard Henderson writes: > On Wed, Sep 01, 2004 at 11:32:21AM +0200, Andreas Schwab wrote: >> * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h [g++ >= 3.5]: Use >> __builtin_offsetof. > > Perhaps include stddef.h and use offsetof properly? If it's ok to include that here, sure. 2004-09-01 Andreas Schwab * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Repace _SC_GR0_OFFSET by offsetof. --- sysdeps/unix/sysv/linux/ia64/sys/ucontext.h 16 Jan 2003 11:33:48 +0100 1.7 +++ sysdeps/unix/sysv/linux/ia64/sys/ucontext.h 01 Sep 2004 22:41:55 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ #include #include +#include #include @@ -32,13 +33,6 @@ typedef struct sigcontext mcontext_t; -#ifdef __GNUC__ -# define _SC_GR0_OFFSET \ - (((char *) &((struct sigcontext *) 0)->sc_gr[0]) - (char *) 0) -#else -# define _SC_GR0_OFFSET 0xc8 /* pray that this is correct... */ -#endif - typedef struct ucontext { union @@ -46,7 +40,7 @@ typedef struct ucontext mcontext_t _mc; struct { - unsigned long _pad[_SC_GR0_OFFSET/8]; + unsigned long _pad[offsetof (struct sigcontext, sc_gr[0]) / 8]; struct ucontext *_link; /* this should overlay sc_gr[0] */ } _uc; Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."