public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: libc-hacker@sources.redhat.com
Subject: Re: Fix ia64/sys/ucontext.h für g++ 3.5
Date: Wed, 01 Sep 2004 20:56:00 -0000	[thread overview]
Message-ID: <jewtzdg13p.fsf@sykes.suse.de> (raw)
In-Reply-To: <20040901172520.GA17065@twiddle.net> (Richard Henderson's message of "Wed, 1 Sep 2004 10:25:20 -0700")

Richard Henderson <rth@twiddle.net> 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  <schwab@suse.de>

	* 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 <features.h>
 #include <signal.h>
+#include <stddef.h>
 
 #include <bits/sigcontext.h>
 
@@ -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."

  reply	other threads:[~2004-09-01 20:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-01  9:32 Andreas Schwab
2004-09-01 17:25 ` Richard Henderson
2004-09-01 20:56   ` Andreas Schwab [this message]
2004-09-01 21:07     ` Ulrich Drepper
2004-09-01 21:11       ` Jakub Jelinek
2004-09-04  1:58         ` Richard Henderson
2004-09-02  3:40 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jewtzdg13p.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).