mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Fix make-polar signedness of zeros on macOS
* configure.ac: Check for __sincos. * libguile/numbers.c (scm_c_make_polar): Fall back to __sincos if possible. Fixes zero signedness of make-polar on macOS.
This commit is contained in:
parent
36023a0d2e
commit
c4b0491e91
2 changed files with 4 additions and 1 deletions
|
@ -1152,8 +1152,9 @@ AC_REPLACE_FUNCS([strerror memmove])
|
||||||
# asinh, acosh, atanh, trunc - C99 standard, generally not available on
|
# asinh, acosh, atanh, trunc - C99 standard, generally not available on
|
||||||
# older systems
|
# older systems
|
||||||
# sincos - GLIBC extension
|
# sincos - GLIBC extension
|
||||||
|
# __sincos - APPLE extension
|
||||||
#
|
#
|
||||||
AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
|
AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos __sincos trunc)
|
||||||
|
|
||||||
# C99 specifies isinf and isnan as macros.
|
# C99 specifies isinf and isnan as macros.
|
||||||
# HP-UX provides only macros, no functions.
|
# HP-UX provides only macros, no functions.
|
||||||
|
|
|
@ -9109,6 +9109,8 @@ scm_c_make_polar (double mag, double ang)
|
||||||
details. */
|
details. */
|
||||||
#if (defined HAVE_SINCOS) && (defined __GLIBC__) && (defined _GNU_SOURCE)
|
#if (defined HAVE_SINCOS) && (defined __GLIBC__) && (defined _GNU_SOURCE)
|
||||||
sincos (ang, &s, &c);
|
sincos (ang, &s, &c);
|
||||||
|
#elif (defined HAVE___SINCOS)
|
||||||
|
__sincos (ang, &s, &c);
|
||||||
#else
|
#else
|
||||||
s = sin (ang);
|
s = sin (ang);
|
||||||
c = cos (ang);
|
c = cos (ang);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue