From c4b0491e91a7c4d4a2b89511b37eae61e79de47a Mon Sep 17 00:00:00 2001 From: Matt Wette Date: Tue, 21 Feb 2017 22:07:39 +0100 Subject: [PATCH] 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. --- configure.ac | 3 ++- libguile/numbers.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 020151911..8c90d3feb 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/libguile/numbers.c b/libguile/numbers.c index 07170d922..b926d2472 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -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);