mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2025-04-03 17:17:13 +02:00
Suggestions
https://github.com/JuliaMath/openlibm/pull/197#pullrequestreview-307404318
This commit is contained in:
parent
ea065f90cb
commit
d4077aa131
8 changed files with 42 additions and 32 deletions
|
@ -12,43 +12,49 @@
|
|||
#endif /* !defined(__BEGIN_DECLS) */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifndef __strong_reference
|
||||
#ifdef __APPLE__
|
||||
#define __strong_reference(sym,aliassym) __weak_reference_compat(sym,aliassym)
|
||||
#if defined(__strong_alias) && defined(__NetBSD__)
|
||||
#define openlibm_strong_reference(sym,alias) __strong_alias(alias,sym)
|
||||
#elif defined(__strong_reference)
|
||||
#define openlibm_strong_reference(sym,alias) __strong_reference(sym,alias)
|
||||
#else
|
||||
#define __strong_reference(sym,aliassym) \
|
||||
#ifdef __APPLE__
|
||||
#define openlibm_strong_reference(sym,aliassym) openlibm_weak_reference(sym,aliassym)
|
||||
#else
|
||||
#define openlibm_strong_reference(sym,aliassym) \
|
||||
OLM_DLLEXPORT extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
|
||||
#endif /* __APPLE__ */
|
||||
#endif /* __strong_reference */
|
||||
|
||||
#ifdef __wasm__
|
||||
# define __weak_reference_compat(sym,alias) __strong_reference(sym,alias)
|
||||
# define openlibm_weak_reference(sym,alias) openlibm_strong_reference(sym,alias)
|
||||
#endif
|
||||
|
||||
#ifdef __weak_reference
|
||||
#ifdef __NetBSD__
|
||||
#define __weak_reference_compat(sym,alias) __weak_alias(alias,sym)
|
||||
#else
|
||||
#define __weak_reference_compat(sym,alias) __weak_reference(sym,alias)
|
||||
#endif
|
||||
#if defined(__weak_alias) && defined(__NetBSD__)
|
||||
#define openlibm_weak_reference(sym,alias) __weak_alias(alias,sym)
|
||||
#elif defined(__weak_reference)
|
||||
#define openlibm_weak_reference(sym,alias) __weak_reference(sym,alias)
|
||||
#else
|
||||
#ifdef __ELF__
|
||||
#ifdef __STDC__
|
||||
#define __weak_reference_compat(sym,alias) \
|
||||
#define openlibm_weak_reference(sym,alias) \
|
||||
__asm__(".weak " #alias); \
|
||||
__asm__(".equ " #alias ", " #sym)
|
||||
#ifndef __warn_references
|
||||
#define __warn_references(sym,msg) \
|
||||
#ifdef __warn_references
|
||||
#define openlibm_warn_references(sym,msg) __warn_references(sym,msg)
|
||||
#else
|
||||
#define openlibm_warn_references(sym,msg) \
|
||||
__asm__(".section .gnu.warning." #sym); \
|
||||
__asm__(".asciz \"" msg "\""); \
|
||||
__asm__(".previous")
|
||||
#endif /* __warn_references */
|
||||
#else
|
||||
#define __weak_reference_compat(sym,alias) \
|
||||
#define openlibm_weak_reference(sym,alias) \
|
||||
__asm__(".weak alias"); \
|
||||
__asm__(".equ alias, sym")
|
||||
#ifndef __warn_references
|
||||
#define __warn_references(sym,msg) \
|
||||
#ifdef __warn_references
|
||||
#define openlibm_warn_references(sym,msg) __warn_references(sym,msg)
|
||||
#else
|
||||
#define openlibm_warn_references(sym,msg) \
|
||||
__asm__(".section .gnu.warning.sym"); \
|
||||
__asm__(".asciz \"msg\""); \
|
||||
__asm__(".previous")
|
||||
|
@ -56,30 +62,34 @@
|
|||
#endif /* __STDC__ */
|
||||
#elif defined(__clang__) /* CLANG */
|
||||
#ifdef __STDC__
|
||||
#define __weak_reference_compat(sym,alias) \
|
||||
#define openlibm_weak_reference(sym,alias) \
|
||||
__asm__(".weak_reference " #alias); \
|
||||
__asm__(".set " #alias ", " #sym)
|
||||
#else
|
||||
#define __weak_referenc_compate(sym,alias) \
|
||||
#define openlibm_weak_reference(sym,alias) \
|
||||
__asm__(".weak_reference alias");\
|
||||
__asm__(".set alias, sym")
|
||||
#endif
|
||||
#else /* !__ELF__ */
|
||||
#ifdef __STDC__
|
||||
#define __weak_reference_compat(sym,alias) \
|
||||
#define openlibm_weak_reference(sym,alias) \
|
||||
__asm__(".stabs \"_" #alias "\",11,0,0,0"); \
|
||||
__asm__(".stabs \"_" #sym "\",1,0,0,0")
|
||||
#ifndef __warn_references
|
||||
#define __warn_references(sym,msg) \
|
||||
#ifdef __warn_references
|
||||
#define openlibm_warn_references(sym,msg) __warn_references(sym,msg)
|
||||
#else
|
||||
#define openlibm_warn_references(sym,msg) \
|
||||
__asm__(".stabs \"" msg "\",30,0,0,0"); \
|
||||
__asm__(".stabs \"_" #sym "\",1,0,0,0")
|
||||
#endif /* __warn_references */
|
||||
#else
|
||||
#define __weak_reference_compat(sym,alias) \
|
||||
#define openlibm_weak_reference(sym,alias) \
|
||||
__asm__(".stabs \"_/**/alias\",11,0,0,0"); \
|
||||
__asm__(".stabs \"_/**/sym\",1,0,0,0")
|
||||
#ifndef __warn_references
|
||||
#define __warn_references(sym,msg) \
|
||||
#ifdef __warn_references
|
||||
#define openlibm_warn_references(sym,msg) __warn_references(sym,msg)
|
||||
#else
|
||||
#define openlibm_warn_references(sym,msg) \
|
||||
__asm__(".stabs msg,30,0,0,0"); \
|
||||
__asm__(".stabs \"_/**/sym\",1,0,0,0")
|
||||
#endif /* __warn_references */
|
||||
|
|
|
@ -107,5 +107,5 @@ __ieee754_acos(double x)
|
|||
}
|
||||
|
||||
#if LDBL_MANT_DIG == 53
|
||||
__weak_reference_compat(acos, acosl);
|
||||
openlibm_weak_reference(acos, acosl);
|
||||
#endif
|
||||
|
|
|
@ -113,5 +113,5 @@ __ieee754_asin(double x)
|
|||
}
|
||||
|
||||
#if LDBL_MANT_DIG == 53
|
||||
__weak_reference_compat(asin, asinl);
|
||||
openlibm_weak_reference(asin, asinl);
|
||||
#endif
|
||||
|
|
|
@ -125,5 +125,5 @@ __ieee754_atan2(double y, double x)
|
|||
}
|
||||
|
||||
#if LDBL_MANT_DIG == 53
|
||||
__weak_reference_compat(atan2, atan2l);
|
||||
openlibm_weak_reference(atan2, atan2l);
|
||||
#endif
|
||||
|
|
|
@ -127,5 +127,5 @@ __ieee754_hypot(double x, double y)
|
|||
}
|
||||
|
||||
#if LDBL_MANT_DIG == 53
|
||||
__weak_reference_compat(hypot, hypotl);
|
||||
openlibm_weak_reference(hypot, hypotl);
|
||||
#endif
|
||||
|
|
|
@ -75,5 +75,5 @@ __ieee754_remainder(double x, double p)
|
|||
}
|
||||
|
||||
#if LDBL_MANT_DIG == 53
|
||||
__weak_reference_compat(remainder, remainderl);
|
||||
openlibm_weak_reference(remainder, remainderl);
|
||||
#endif
|
||||
|
|
|
@ -189,7 +189,7 @@ __ieee754_sqrt(double x)
|
|||
}
|
||||
|
||||
#if (LDBL_MANT_DIG == 53)
|
||||
__weak_reference_compat(sqrt, sqrtl);
|
||||
openlibm_weak_reference(sqrt, sqrtl);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -120,5 +120,5 @@ atan(double x)
|
|||
}
|
||||
|
||||
#if LDBL_MANT_DIG == 53
|
||||
__weak_reference_compat(atan, atanl);
|
||||
openlibm_weak_reference(atan, atanl);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue