Subject: Re: CVS commit: src/lib/csu/i386_elf
To: Jason Thorpe <thorpej@shagadelic.org>
From: David Laight <david@l8s.co.uk>
List: source-changes
Date: 05/17/2006 22:39:20
On Wed, May 17, 2006 at 02:14:38PM -0700, Jason Thorpe wrote:
> Way too much weak function grief.
How about:
#if __GNUC_PREREQ__(4, 0)
#define __weak_reference(sym) __attribute__((__weakref__))
#else
#define __weak_reference(sym) ; __asm(".weak " _C_LABEL_STRING(#sym))
#endif
So you do:
int weak_fn(void) __weak_reference(weak_fn);
I just dislike #if's in code so much :-)
David
--
David Laight: david@l8s.co.uk