Kaynağa Gözat

Fix __weak_reference for clang [closes #9]

Keno Fischer 12 yıl önce
ebeveyn
işleme
4b078ee343
1 değiştirilmiş dosya ile 9 ekleme ve 3 silme
  1. 9 3
      include/cdefs-compat.h

+ 9 - 3
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)	\