Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/csu/i386_elf



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@localhost



Home | Main Index | Thread Index | Old Index