1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +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:
Matt Wette 2017-02-21 22:07:39 +01:00 committed by Andy Wingo
parent 36023a0d2e
commit c4b0491e91
2 changed files with 4 additions and 1 deletions

View file

@ -1152,8 +1152,9 @@ AC_REPLACE_FUNCS([strerror memmove])
# asinh, acosh, atanh, trunc - C99 standard, generally not available on
# older systems
# 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.
# HP-UX provides only macros, no functions.

View file

@ -9109,6 +9109,8 @@ scm_c_make_polar (double mag, double ang)
details. */
#if (defined HAVE_SINCOS) && (defined __GLIBC__) && (defined _GNU_SOURCE)
sincos (ang, &s, &c);
#elif (defined HAVE___SINCOS)
__sincos (ang, &s, &c);
#else
s = sin (ang);
c = cos (ang);