NetBSD fix

This commit is contained in:
gufe44 2019-10-25 18:32:47 +02:00 committed by GitHub
parent 14bf902a7e
commit 2080b23690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 47 additions and 41 deletions

View file

@ -14,7 +14,7 @@
#ifdef __GNUC__ #ifdef __GNUC__
#ifndef __strong_reference #ifndef __strong_reference
#ifdef __APPLE__ #ifdef __APPLE__
#define __strong_reference(sym,aliassym) __weak_reference(sym,aliassym) #define __strong_reference(sym,aliassym) __weak_reference_compat(sym,aliassym)
#else #else
#define __strong_reference(sym,aliassym) \ #define __strong_reference(sym,aliassym) \
OLM_DLLEXPORT extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); OLM_DLLEXPORT extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
@ -22,13 +22,19 @@
#endif /* __strong_reference */ #endif /* __strong_reference */
#ifdef __wasm__ #ifdef __wasm__
# define __weak_reference(sym,alias) __strong_reference(sym,alias) # define __weak_reference_compat(sym,alias) __strong_reference(sym,alias)
#endif #endif
#ifndef __weak_reference #ifdef __weak_reference
#ifdef __NetBSD__
#define __weak_reference_compat(sym,alias) __weak_reference(sym)
#else
#define __weak_reference_compat(sym,alias) __weak_reference(sym,alias)
#endif
#else
#ifdef __ELF__ #ifdef __ELF__
#ifdef __STDC__ #ifdef __STDC__
#define __weak_reference(sym,alias) \ #define __weak_reference_compat(sym,alias) \
__asm__(".weak " #alias); \ __asm__(".weak " #alias); \
__asm__(".equ " #alias ", " #sym) __asm__(".equ " #alias ", " #sym)
#ifndef __warn_references #ifndef __warn_references
@ -38,7 +44,7 @@
__asm__(".previous") __asm__(".previous")
#endif /* __warn_references */ #endif /* __warn_references */
#else #else
#define __weak_reference(sym,alias) \ #define __weak_reference_compat(sym,alias) \
__asm__(".weak alias"); \ __asm__(".weak alias"); \
__asm__(".equ alias, sym") __asm__(".equ alias, sym")
#ifndef __warn_references #ifndef __warn_references
@ -50,17 +56,17 @@
#endif /* __STDC__ */ #endif /* __STDC__ */
#elif defined(__clang__) /* CLANG */ #elif defined(__clang__) /* CLANG */
#ifdef __STDC__ #ifdef __STDC__
#define __weak_reference(sym,alias) \ #define __weak_reference_compat(sym,alias) \
__asm__(".weak_reference " #alias); \ __asm__(".weak_reference " #alias); \
__asm__(".set " #alias ", " #sym) __asm__(".set " #alias ", " #sym)
#else #else
#define __weak_reference(sym,alias) \ #define __weak_referenc_compate(sym,alias) \
__asm__(".weak_reference alias");\ __asm__(".weak_reference alias");\
__asm__(".set alias, sym") __asm__(".set alias, sym")
#endif #endif
#else /* !__ELF__ */ #else /* !__ELF__ */
#ifdef __STDC__ #ifdef __STDC__
#define __weak_reference(sym,alias) \ #define __weak_reference_compat(sym,alias) \
__asm__(".stabs \"_" #alias "\",11,0,0,0"); \ __asm__(".stabs \"_" #alias "\",11,0,0,0"); \
__asm__(".stabs \"_" #sym "\",1,0,0,0") __asm__(".stabs \"_" #sym "\",1,0,0,0")
#ifndef __warn_references #ifndef __warn_references
@ -69,7 +75,7 @@
__asm__(".stabs \"_" #sym "\",1,0,0,0") __asm__(".stabs \"_" #sym "\",1,0,0,0")
#endif /* __warn_references */ #endif /* __warn_references */
#else #else
#define __weak_reference(sym,alias) \ #define __weak_reference_compat(sym,alias) \
__asm__(".stabs \"_/**/alias\",11,0,0,0"); \ __asm__(".stabs \"_/**/alias\",11,0,0,0"); \
__asm__(".stabs \"_/**/sym\",1,0,0,0") __asm__(".stabs \"_/**/sym\",1,0,0,0")
#ifndef __warn_references #ifndef __warn_references

View file

@ -107,5 +107,5 @@ __ieee754_acos(double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(acos, acosl); __weak_reference_compat(acos, acosl);
#endif #endif

View file

@ -113,5 +113,5 @@ __ieee754_asin(double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(asin, asinl); __weak_reference_compat(asin, asinl);
#endif #endif

View file

@ -125,5 +125,5 @@ __ieee754_atan2(double y, double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(atan2, atan2l); __weak_reference_compat(atan2, atan2l);
#endif #endif

View file

@ -127,5 +127,5 @@ __ieee754_hypot(double x, double y)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(hypot, hypotl); __weak_reference_compat(hypot, hypotl);
#endif #endif

View file

@ -75,5 +75,5 @@ __ieee754_remainder(double x, double p)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(remainder, remainderl); __weak_reference_compat(remainder, remainderl);
#endif #endif

View file

@ -189,7 +189,7 @@ __ieee754_sqrt(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(sqrt, sqrtl); __weak_reference_compat(sqrt, sqrtl);
#endif #endif
/* /*

View file

@ -120,5 +120,5 @@ atan(double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(atan, atanl); __weak_reference_compat(atan, atanl);
#endif #endif

View file

@ -114,5 +114,5 @@ cbrt(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(cbrt, cbrtl); __weak_reference_compat(cbrt, cbrtl);
#endif #endif

View file

@ -73,5 +73,5 @@ ceil(double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(ceil, ceill); __weak_reference_compat(ceil, ceill);
#endif #endif

View file

@ -85,5 +85,5 @@ cos(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(cos, cosl); __weak_reference_compat(cos, cosl);
#endif #endif

View file

@ -43,5 +43,5 @@ cproj(double complex z)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(cproj, cprojl); __weak_reference_compat(cproj, cprojl);
#endif #endif

View file

@ -110,5 +110,5 @@ csqrt(double complex z)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(csqrt, csqrtl); __weak_reference_compat(csqrt, csqrtl);
#endif #endif

View file

@ -392,5 +392,5 @@ exp2(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(exp2, exp2l); __weak_reference_compat(exp2, exp2l);
#endif #endif

View file

@ -74,5 +74,5 @@ floor(double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(floor, floorl); __weak_reference_compat(floor, floorl);
#endif #endif

View file

@ -280,5 +280,5 @@ fma(double x, double y, double z)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(fma, fmal); __weak_reference_compat(fma, fmal);
#endif #endif

View file

@ -52,5 +52,5 @@ frexp(double x, int *eptr)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(frexp, frexpl); __weak_reference_compat(frexp, frexpl);
#endif #endif

View file

@ -63,4 +63,4 @@ __isinfl(long double e)
} }
#endif #endif
__weak_reference(__isinff, isinff); __weak_reference_compat(__isinff, isinff);

View file

@ -64,4 +64,4 @@ __isnanl(long double e)
} }
#endif #endif
__weak_reference(__isnanf, isnanf); __weak_reference_compat(__isnanf, isnanf);

View file

@ -45,5 +45,5 @@ logb(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(logb, logbl); __weak_reference_compat(logb, logbl);
#endif #endif

View file

@ -120,5 +120,5 @@ nanf(const char *s)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(nan, nanl); __weak_reference_compat(nan, nanl);
#endif #endif

View file

@ -77,7 +77,7 @@ nextafter(double x, double y)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(nextafter, nexttoward); __weak_reference_compat(nextafter, nexttoward);
__weak_reference(nextafter, nexttowardl); __weak_reference_compat(nextafter, nexttowardl);
__weak_reference(nextafter, nextafterl); __weak_reference_compat(nextafter, nextafterl);
#endif #endif

View file

@ -154,5 +154,5 @@ fixup:
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(remquo, remquol); __weak_reference_compat(remquo, remquol);
#endif #endif

View file

@ -88,5 +88,5 @@ rint(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(rint, rintl); __weak_reference_compat(rint, rintl);
#endif #endif

View file

@ -59,8 +59,8 @@ scalbn (double x, int n)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(scalbn, ldexpl); __weak_reference_compat(scalbn, ldexpl);
__weak_reference(scalbn, scalbnl); __weak_reference_compat(scalbn, scalbnl);
#endif #endif
__strong_reference(scalbn, ldexp); __strong_reference(scalbn, ldexp);

View file

@ -85,5 +85,5 @@ sin(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(sin, sinl); __weak_reference_compat(sin, sinl);
#endif #endif

View file

@ -146,5 +146,5 @@ sincos(double x, double * s, double * c)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(sincos, sincosl); __weak_reference_compat(sincos, sincosl);
#endif #endif

View file

@ -79,5 +79,5 @@ tan(double x)
} }
#if (LDBL_MANT_DIG == 53) #if (LDBL_MANT_DIG == 53)
__weak_reference(tan, tanl); __weak_reference_compat(tan, tanl);
#endif #endif

View file

@ -63,5 +63,5 @@ trunc(double x)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(trunc, truncl); __weak_reference_compat(trunc, truncl);
#endif #endif

View file

@ -21,5 +21,5 @@ cabs(double complex z)
} }
#if LDBL_MANT_DIG == 53 #if LDBL_MANT_DIG == 53
__weak_reference(cabs, cabsl); __weak_reference_compat(cabs, cabsl);
#endif #endif