From 4b078ee343e0b81928ffd5acee689ae7910a1aa7 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 3 Jul 2012 13:50:00 +0200 Subject: [PATCH] Fix __weak_reference for clang [closes #9] --- include/cdefs-compat.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/cdefs-compat.h b/include/cdefs-compat.h index 5a99790..25ac406 100644 --- a/include/cdefs-compat.h +++ b/include/cdefs-compat.h @@ -50,9 +50,15 @@ __asm__(".previous") #endif /* __STDC__ */ #elif defined(__clang__) /* CLANG */ -#define __weak_reference(sym,alias) \ - __asm__(".weak_reference alias");\ - __asm__(".set alias, sym") +#ifdef __STDC__ +#define __weak_reference(sym,alias) \ + __asm__(".weak_reference " #alias); \ + __asm__(".set " #alias ", " #sym) +#else +#define __weak_reference(sym,alias) \ + __asm__(".weak_reference alias");\ + __asm__(".set alias, sym") +#endif #else /* !__ELF__ */ #ifdef __STDC__ #define __weak_reference(sym,alias) \